草庐IT

test_name

全部标签

c++ - 振奋 spirit : What type names should be used for the built in terminals?

我正在重构一个类型系统(类型模型),它使用spirit进行字符串序列化。我正在使用类型特征的编译时建模构造。templatetype_traits{typedefboost::spirit::qi::int_parserstring_parser;}templatetype_traits{typedefboost::spirit::ascii::stringstring_parser;}在这个例子中,我展示了原始解析器,但我希望也加入规则。int4类型有效,但这是因为(home/qi/numeric/int.hpp+27):namespacetag{templatestructint_

openssl3.2/test/certs - 027 - server intermediate ca: sca-cert

文章目录openssl3.2/test/certs-027-serverintermediateca:sca-cert概述笔记ENDopenssl3.2/test/certs-027-serverintermediateca:sca-cert概述openssl3.2-官方demo学习-test-certs笔记//\filemy_openssl_linux_log_doc_027.txt//\noteopenssl3.2/test/certs-027-serverintermediateca:sca-cert//------------------------------------------

python - c++中python "type(<name>, <bases>, <dict>)"的等价物是什么?

好吧,我正在将python3.3嵌入到C++应用程序中。我希望在C++端动态创建一个Python类,就像我在Python中执行以下操作一样:my_type=type("MyType",(object,),dict())我知道我总是可以导入“builtins”模块,但我一般会尽量避免在C++端导入。谢谢! 最佳答案 以下似乎工作得很好:PyObject*type(constchar*name,boost::python::tuplebases,boost::python::dictdict){returnPyType_Type.tp_

c++ - CMake "clang++ is not able compile a simple test program"(软呢帽 20)

所以我尝试安装clang+cmake来编译一个简单的C++程序,但出现以下错误:--TheCcompileridentificationisGNU4.8.3--TheCXXcompileridentificationisClang3.5.0--CheckforworkingCcompiler:/usr/bin/cc--CheckforworkingCcompiler:/usr/bin/cc--works--DetectingCcompilerABIinfo--DetectingCcompilerABIinfo-done--CheckforworkingCXXcompiler:/usr/

c++ - 编译错误 : `‘error_category’ does not name a type` with g++ 6. 3.0

我尝试编译这个C++/Python库https://bitbucket.org/fluiddyn/fluidfft如果安装了mpi4py,它运行良好。如果没有安装mpi4py,不使用MPI的代码无法编译。编译Cython文件时出现错误。错误很长,开始于:Infileincludedfrom/usr/include/c++/6/bits/ios_base.h:46:0,from/usr/include/c++/6/ios:42,from/usr/include/c++/6/ostream:38,from/usr/include/c++/6/iostream:39,fromsrc_cpp/

c++ - Boost Test 寄存器异常翻译器

有人知道在Boost.Test中使用自动测试用例时如何注册我的自定义异常转换器吗?我找到了一些示例(实际上很少),但它们没有显示如何将此功能与自动测试用例一起使用,这在我看来是boost.test的最大优势。我的示例测试套件:#defineBOOST_TEST_MODULEStateMachineTest#defineBOOST_TEST_DYN_LINK#includeBOOST_AUTO_TEST_SUITE(FirstTest);BOOST_AUTO_TEST_CASE(testBasic){BOOST_CHECK(true);}BOOST_AUTO_TEST_SUITE_END

c++ - boost named_semaphore 示例?

我没能找到一个很好的例子来展示如何使用boost::interprocess::named_semaphore(甚至在Boost网站上也没有)。我可以看到一些关于interprocess_semaphore的东西,但它们似乎完全不同,我不知道为一个显示的内容是否也适用于另一个。任何人都可以给我一些指向此类示例/tutorials/documentation的链接吗?谢谢。 最佳答案 interprocess_semaphore和named_semaphore之间的主要区别在于interprocess_semaphore是通过使用共享

c++ - 在 boost::test::unit_test 中查找内存泄漏

这个问题是continuationtoapreviousquestion在boost::test::unit_test上。我已经编写了单元测试并构建了单元测试。这是构建输出:2>------Buildstarted:Project:UnitTests,Configuration:DebugWin32------2>stdafx.cpp2>UnitTests.cpp2>UnitTests.vcxproj->F:\Src\Crash\trunk\Debug\UnitTests.exe2>2>Running3testcases...2>Testsuite"MasterTestSuite"pa

c++ - 使用 Boost::Test 并行代码

我想用boost::unit_test为我的并行(基于mpi)C++代码创建一些测试。我对使用测试框架有一些基本的经验。对我来说,主要的问题是,在使用并行代码时,将MPI::Init放在哪里,以便首先调用它。在我创建的测试套件中没有主要功能。此外,当某些断言在现有等级的子集上失败时,Boost::Test是否正确存在(相对于mpi)? 最佳答案 Boost测试有fixturesupport,它允许您针对每个测试用例、测试套件或全局执行设置/清理。听起来您应该将对MPI::Init的调用放在全局固定装置中。structMPIFixtu

c++ - Qt错误: 'const class QString' has no member named 'toStdString'

我收到此错误error:'constclassQString'hasnomembernamed'toStdString'虽然QString有它。(link).代码std::stringMessage::toStdString()const{returnm_string.toStdString();} 最佳答案 直接从这里复制答案:HowtoconvertQStringtostd::string?QStringqs;//EitherthisifyouuseUTF-8anywherestd::stringutf8_text=qs.toU