- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我首先将一个 utf-8 字符串转换为 utf-32,然后我希望将唯一的单词与其位置进行映射。我从 boost 语言环境开始。
#include <iostream>
#include <string>
#include <chrono>
#include <boost/shared_ptr.hpp>
#include <map>
#include <list>
#include <boost/locale.hpp>
typedef std::u32string string_type;
typedef std::pair<unsigned long, unsigned long> range_type;
typedef std::map<std::string, std::list<range_type>> wordref_type;
struct parser{
/**
* returns a map of "words" with its positions list
*/
static wordref_type parse(string_type::const_iterator b, string_type::const_iterator e){
wordref_type wordrefs;
range_type sentence;
boost::locale::boundary::segment_index<string_type::const_iterator> index(boost::locale::boundary::word, b, e);
//TODO: iterate index
return wordrefs;
}
};
int main(int argc, char** argv){
std::string input_str = "Some UTF-8 texts";
string_type buffer = boost::locale::conv::utf_to_utf<string_type::value_type>(input_str); // convert utf-8 to utf-32
wordref_type wordrefs = parser::parse(buffer.cbegin(), buffer.cend());
return 0;
}
它提示invalid use of incomplete type ‘const class boost::locale::boundary::boundary_indexing<char32_t>’
.怎么了 ?我有Ideone编辑它
In file included from /usr/include/boost/locale/boundary.hpp:15:0,
from /usr/include/boost/locale.hpp:11,
from prog.cpp:7:
/usr/include/boost/locale/boundary/index.hpp: In instantiation of ‘static boost::locale::boundary::index_type boost::locale::boundary::details::mapping_traits<IteratorType, std::random_access_iterator_tag>::map(boost::locale::boundary::boundary_type, IteratorType, IteratorType, const std::locale&) [with IteratorType = __gnu_cxx::__normal_iterator<const char32_t*, std::__cxx11::basic_string<char32_t> >; boost::locale::boundary::index_type = std::vector<boost::locale::boundary::break_info>]’:
/usr/include/boost/locale/boundary/index.hpp:126:83: required from ‘boost::locale::boundary::details::mapping<BaseIterator>::mapping(boost::locale::boundary::boundary_type, boost::locale::boundary::details::mapping<BaseIterator>::base_iterator, boost::locale::boundary::details::mapping<BaseIterator>::base_iterator, const std::locale&) [with BaseIterator = __gnu_cxx::__normal_iterator<const char32_t*, std::__cxx11::basic_string<char32_t> >; boost::locale::boundary::details::mapping<BaseIterator>::base_iterator = __gnu_cxx::__normal_iterator<const char32_t*, std::__cxx11::basic_string<char32_t> >]’
/usr/include/boost/locale/boundary/index.hpp:631:43: required from ‘boost::locale::boundary::segment_index<BaseIterator>::segment_index(boost::locale::boundary::boundary_type, boost::locale::boundary::segment_index<BaseIterator>::base_iterator, boost::locale::boundary::segment_index<BaseIterator>::base_iterator, const std::locale&) [with BaseIterator = __gnu_cxx::__normal_iterator<const char32_t*, std::__cxx11::basic_string<char32_t> >; boost::locale::boundary::segment_index<BaseIterator>::base_iterator = __gnu_cxx::__normal_iterator<const char32_t*, std::__cxx11::basic_string<char32_t> >]’
prog.cpp:21:118: required from here
/usr/include/boost/locale/boundary/index.hpp:98:93: error: invalid use of incomplete type ‘const class boost::locale::boundary::boundary_indexing<char32_t>’
index_type tmp=std::use_facet<boundary_indexing<char_type> >(l).map(t,begin,end);
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~
In file included from /usr/include/boost/locale/boundary.hpp:12:0,
from /usr/include/boost/locale.hpp:11,
from prog.cpp:7:
/usr/include/boost/locale/boundary/facets.hpp:90:19: note: declaration of ‘class boost::locale::boundary::boundary_indexing<char32_t>’
class boundary_indexing;
^~~~~~~~~~~~~~~~~
In file included from /usr/include/boost/locale/boundary.hpp:15:0,
from /usr/include/boost/locale.hpp:11,
from prog.cpp:7:
/usr/include/boost/locale/boundary/index.hpp:103:95: error: invalid use of incomplete type ‘const class boost::locale::boundary::boundary_indexing<char32_t>’
index_type tmp = std::use_facet<boundary_indexing<char_type> >(l).map(t,str.c_str(),str.c_str()+str.size());
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~
In file included from /usr/include/boost/locale/boundary.hpp:12:0,
from /usr/include/boost/locale.hpp:11,
from prog.cpp:7:
/usr/include/boost/locale/boundary/facets.hpp:90:19: note: declaration of ‘class boost::locale::boundary::boundary_indexing<char32_t>’
class boundary_indexing;
^~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/6/bits/locale_classes.h:850:0,
from /usr/include/c++/6/bits/ios_base.h:41,
from /usr/include/c++/6/ios:42,
from /usr/include/c++/6/ostream:38,
from /usr/include/c++/6/iostream:39,
from prog.cpp:1:
/usr/include/c++/6/bits/locale_classes.tcc: In instantiation of ‘const _Facet& std::use_facet(const std::locale&) [with _Facet = boost::locale::boundary::boundary_indexing<char32_t>]’:
/usr/include/boost/locale/boundary/index.hpp:98:89: required from ‘static boost::locale::boundary::index_type boost::locale::boundary::details::mapping_traits<IteratorType, std::random_access_iterator_tag>::map(boost::locale::boundary::boundary_type, IteratorType, IteratorType, const std::locale&) [with IteratorType = __gnu_cxx::__normal_iterator<const char32_t*, std::__cxx11::basic_string<char32_t> >; boost::locale::boundary::index_type = std::vector<boost::locale::boundary::break_info>]’
/usr/include/boost/locale/boundary/index.hpp:126:83: required from ‘boost::locale::boundary::details::mapping<BaseIterator>::mapping(boost::locale::boundary::boundary_type, boost::locale::boundary::details::mapping<BaseIterator>::base_iterator, boost::locale::boundary::details::mapping<BaseIterator>::base_iterator, const std::locale&) [with BaseIterator = __gnu_cxx::__normal_iterator<const char32_t*, std::__cxx11::basic_string<char32_t> >; boost::locale::boundary::details::mapping<BaseIterator>::base_iterator = __gnu_cxx::__normal_iterator<const char32_t*, std::__cxx11::basic_string<char32_t> >]’
/usr/include/boost/locale/boundary/index.hpp:631:43: required from ‘boost::locale::boundary::segment_index<BaseIterator>::segment_index(boost::locale::boundary::boundary_type, boost::locale::boundary::segment_index<BaseIterator>::base_iterator, boost::locale::boundary::segment_index<BaseIterator>::base_iterator, const std::locale&) [with BaseIterator = __gnu_cxx::__normal_iterator<const char32_t*, std::__cxx11::basic_string<char32_t> >; boost::locale::boundary::segment_index<BaseIterator>::base_iterator = __gnu_cxx::__normal_iterator<const char32_t*, std::__cxx11::basic_string<char32_t> >]’
prog.cpp:21:118: required from here
/usr/include/c++/6/bits/locale_classes.tcc:134:37: error: incomplete type ‘boost::locale::boundary::boundary_indexing<char32_t>’ used in nested name specifier
const size_t __i = _Facet::id._M_id();
~~~~~~~~~~~^~~~~
最佳答案
It complains invalid use of incomplete type ‘const class boost::locale::boundary::boundary_indexing’ What's wrong?
char32_t
不受支持。使用
#define BOOST_LOCALE_ENABLE_CHAR32_T
但是你需要enable it在构建库期间,还有:
Experimental support for C++0x char16_t and char32_t strings and streams.
进一步查看:http://www.boost.org/doc/libs/1_64_0/libs/locale/doc/html/status_of_cpp0x_characters_support.html
If you want to build or test Boost.Locale with C++11 char16_t and char32_t support you should pass cxxflags="-DBOOST_LOCALE_ENABLE_CHAR32_T -DBOOST_LOCALE_ENABLE_CHAR16_T" to b2 during build and define BOOST_LOCALE_ENABLE_CHAR32_T and BOOST_LOCALE_ENABLE_CHAR32_T when using Boost.Locale
关于c++ - boost 语言环境不完整类型 boundary_indexing<char32_t>,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48789953/
我在文档中找不到答案,所以我在这里问。 在 Grails 中,当您创建应用程序时,您会默认获得生产、开发等环境。 如果您想为生产构建 WAR,您可以运行以下任一命令: grails war 或者 gr
我们组织的网站正在迁移到 Sitecore CMS,但我们正在努力以某种方式为开发人员 (4)、设计师 (4)、QA 人员 (3)、作者 (10-15) 和批准者 (4-10) 设置环境在他们可以独立
如何在WinCVS中设置CVSROOT环境变量? 最佳答案 简单的回答是:您不需要。 CVSROOT 环境变量被高估了。 CVS(NT) 只会在确定存储库连接字符串的所有其他方法都已用尽时才使用它。人
我最近完成了“learnyouahaskell”一书,现在我想通过构建 yesod 应用程序来应用我所学到的知识。 但是我不确定如何开始。 关于如何设置 yesod 项目似乎有两个选项。一是Stack
在这一章中,我们将讨论创建 C# 编程所需的工具。我们已经提到 C# 是 .Net 框架的一部分,且用于编写 .Net 应用程序。因此,在讨论运行 C# 程序的可用工具之前,让我们先了解一下 C#
运行Ruby 代码需要配置 Ruby 编程语言的环境。本章我们会学习到如何在各个平台上配置安装 Ruby 环境。 各个平台上安装 Ruby 环境 Linux/Unix 上的 Ruby 安装
就目前而言,这个问题不适合我们的问答形式。我们希望答案得到事实、引用或专业知识的支持,但这个问题可能会引起辩论、争论、投票或扩展讨论。如果您觉得这个问题可以改进并可能重新打开,visit the he
我有一个这样的计算(请注意,这只是非常简化的、缩减版的、最小的可重现示例!): computation <- function() # simplified version! { # a lo
我使用环境作为哈希表。键是来自常规文本文档的单词,值是单个整数(某个其他结构的索引)。 当我加载数百万个元素时,更新和查找都变慢了。下面是一些代码来显示行为。 看起来从一开始的行为在 O(n) 中比在
我正在构建一个 R 包并使用 data-raw和 data存储预定义的库 RxODE楷模。这非常有效。 然而,由此产生的.rda文件每代都在变化。某些模型包含 R 环境,并且序列化似乎包含“创建时间”
(不确定问题是否属于这里,所以道歉是为了) 我很喜欢 Sublime Text ,我经常发现 Xcode 缺少一些文本/数据处理的东西。我可能有不止一个问题—— 'Command +/' 注释代码但没
我正在使用 SF2,并且创建了一些有助于项目调试的路由: widget_debug_page: path: /debug/widget/{widgetName} defau
我创建了一个名为 MyDjangoEnv 的 conda 环境。当我尝试使用 source activate MyDjangoEnv 激活它时,出现错误: No such file or direct
有没有办法区分从本地机器运行的包和从 Cordova 应用商店安装的包? 例如,我想像这样设置一个名为“evn”的 JavaScript 变量: if(cordovaLocal){ env = 'de
很难说出这里要问什么。这个问题模棱两可、含糊不清、不完整、过于宽泛或夸夸其谈,无法以目前的形式得到合理的回答。如需帮助澄清此问题以便重新打开,visit the help center . 关闭 1
我的任务是使用 java 和 mysql 开发一个交互式网站:使用 servlet 检索和处理数据,applet 对数据客户端进行特殊处理,并处理客户端对不同数据 View 的请求。 对于使用 jav
这按预期工作: [dgorur@ted ~]$ env -i env [dgorur@ted ~]$ 这样做: [dgorur@ted ~]$ env -i which date which: no
我想进行非常快速的搜索,看来使用哈希(通过环境)是最好的方法。现在,我得到了一个在环境中运行的示例,但它没有返回我需要的内容。 这是一个例子: a system.time(benchEnv(), g
我想开始开发 OpenACC 程序,我有几个问题要问:是否可以在 AMD gpu 上执行 OpenACC 代码? 如果是这样,我正在寻找适用于 Windows 环境的编译器。我花了将近一个小时什么也没
这可能看起来很奇怪,但是有没有办法制作机器(linux/unix 风格 - 最好是 RHEL)。我需要控制机器的速度以确保代码在非常慢的系统上工作并确定正确的断点(在时间方面)。 我能做到的一种方法是
我是一名优秀的程序员,十分优秀!