草庐IT

BOOST_PP_SEQ_FOLD_LEFT

全部标签

c++ - Boost 1.65.1 几何距离策略使用 Visual Studio 2017 编译错误

尝试使用新版本的boost1.65.1编译我的项目时,出现以下错误:C:\Users\twozn\Dev\soundtoolkit\stk\libraries\boost/geometry/strategies/distance.hpp(101):errorC2664:'intboost::mpl::assertion_failed(boost::mpl::assert::type)':cannotconvertargument1from'boost::mpl::failed************(__cdeclboost::geometry::strategy::distance:

c++ - 为返回 C++/.NET 老手学习 Boost 的最快方法

关闭。这个问题不符合StackOverflowguidelines.它目前不接受答案。我们不允许提问寻求书籍、工具、软件库等的推荐。您可以编辑问题,以便用事实和引用来回答。关闭7年前。Improvethisquestion我是一名经验丰富的.NET和C++程序员,过去5年几乎完全使用C#进行编程,现在我不得不“返回”重新开始使用C++进行编程。在成为C#开发人员之前,我是一名核心C++/STL/COM程序员,但当时从未真正使用过Boost(除了使用Boost的智能指针外)。我有点刷新了我对C++的内存,达到了工作水平,现在又热衷于学习Boost。有人可以向我推荐一种快速学习Boost的

c++ - Boost C++ date_time microsec_clock 和 second_clock

我在BoostC++日期时间库中发现了一个奇怪的结果。microsec_clock和second_clock之间存在不一致,我不明白为什么会这样。我使用的是WindowsXP32位我的代码片段:usingnamespaceboost::posix_time;...ptimenow=second_clock::universal_time();std::cout我期望的打印输出是没有毫秒和毫秒的当前时间。但是,我的电脑中有:2009-10-14T16:07:381970-06-24T20:36:09.375890我不明白为什么我的microsec_clock时间里有一个奇怪的日期(197

c++ - 使用 boost::spirit,我如何要求记录的一部分在其自己的行上?

我有一个记录解析器,它抛出多个异常之一以指示哪个规则失败。前题:#include#include#include#include#include#include#includeusingnamespaceboost::spirit;usingnamespaceboost::spirit::ascii;usingnamespaceboost::spirit::qi;usingnamespaceboost::spirit::qi::labels;usingboost::phoenix::function;usingboost::phoenix::ref;usingboost::spirit

c++ - 可以使用带有 boost 的 C++ 匿名函数吗?

我正在尝试解决匿名函数使问题变得非常非常容易的问题,并且想知道这在C++中是否可行。我想做的是(本质上)templateTDoSomething(Tone,functiondosomething){returnone+dosomething(5);}voidGetMyVal(...){DoSomething(1,/*anonymousfunchere*/)}这个例子对于我必须做的事情来说非常非常简单。在C#中,我会执行p=>p*5。我知道使用C++0x这很容易,但我不能使用它。我觉得我应该能够使用boost::lambda或boost::bind和boost::function与占位符

c++ - "pure virtual method called"实现 boost::thread 包装器接口(interface)时

我有一个小包装器,它集中了与线程相关的内容:classThread{protected:boost::thread*m_thread;virtualvoidwork()=0;voiddo_work(){work();}public:Thread():m_thread(NULL){}virtual~Thread(){catch_up();deletem_thread;}inlinevoidcatch_up(){if(m_thread!=NULL){m_thread->join();}}voidrun(){m_thread=newboost::thread(boost::bind(&Thr

c++ - Mac OS X 和静态 boost 库 -> std::string 失败

我在使用GCC4.5的MacOSX10.6.6下遇到静态boost库(来自MacPorts的Boost1.45.0-2,编译为fat/universal(x86/x86_64)库)的一些非常奇怪的问题。错误信息是main(78485)malloc:***errorforobject0x1000e0b20:pointerbeingfreedwasnotallocated***setabreakpointinmalloc_error_breaktodebug[1]78485abort(coredumped)还有一小段会触发这个问题的示例代码:#defineBOOST_FILESYSTEM_

c++ - boost 压缩对和空对象的地址

据我所知,boost::compressed_pair应该确保第一个和第二个memebr的地址不同,同时它会压缩这对。上面写着here.似乎并非如此,它的行为在不同的编译器上是不同的。我正在使用boostv1.47。我错过了什么?structE1{};structE2{};boost::compressed_pairdiff_pair;boost::compressed_pairsame_pair;//clang++andg++4.7printthesameaddressbutVC2010printsdifferentaddresses.printf("differentpairs=%

c++ - 错误 C2678 : binary '=' : no operator found which takes a left-hand operand of type 'const Recipe' (or there is no acceptable conversion)

我正在尝试对每个元素中包含一个int和一个字符串的vector进行排序。它是一个称为vector食谱的类类型的vector。出现上述错误,这是我的代码:在我的Recipe.h文件中structRecipe{public:stringget_cname()const{returnchef_name;}private:intrecipe_id;stringchef_name;在我的Menu.cpp文件中voidMenu::show()const{sort(recipes.begin(),recipes.end(),Sort_by_cname());}在我的Menu.h文件中#include

C++ Boost.Python : 2 problems

所以,我搜索了将我的C++代码与python集成的好工具,首先我查看了boost.python。我从boost文档中获取了helloexamle,并尝试构建并运行它。源代码是(src/hello.cpp):#include#includecharconst*greet(){return"hello,world";}BOOST_PYTHON_MODULE(hello_ext){usingnamespaceboost::python;def("greet",greet);}问题1-Windows和mingw我尝试构建我的结果:g++-obuild\hello.o-c-IE:\Program