草庐IT

ZN5boost

全部标签

c++ - Boost::GIL bits8* 到 gray8_ptr_t 没有 reinterpret_cast?

尝试按照GIL的设计指南工作,我使用bits__对于我的channel数据类型。我经常将外部数据包装到GILImageView中。然而,即使使用bits__数据指针的类型,我必须添加一个reinterpret_cast才能创建我的ImageView。取以下代码intwidth=3;intheight=2;boost::gil::bits8data8[]={0,1,100,200,50,51};boost::gil::bits8*pBits8=data8;boost::gil::gray8_ptr_tpGray8=pBits8;boost::gil::gray8_view_tv=inte

c++ - 使用 boost::program_options 打印普通和位置参数的帮助

当您使用Boost库时program_options为您的程序打印帮助非常容易:boost::program_options::variables_mapoptions;boost::program_options::options_descriptionoptionsDesc;boost::program_options::positional_options_descriptionpositionalOptionsDesc;//...if(options.count("help")){cerr但是如何添加positional_options_description中的选项?到帮助信

c++ - 使用 boost::program_options 打印普通和位置参数的帮助

当您使用Boost库时program_options为您的程序打印帮助非常容易:boost::program_options::variables_mapoptions;boost::program_options::options_descriptionoptionsDesc;boost::program_options::positional_options_descriptionpositionalOptionsDesc;//...if(options.count("help")){cerr但是如何添加positional_options_description中的选项?到帮助信

python - 地址清理 Boost.Python 模块

我的项目包括一个大型C++库和Python绑定(bind)(通过Boost.Python)。测试套件主要是在Python绑定(bind)之上编写的,我想使用sanitizer来运行它,从ASAN开始。我正在运行macOS(10.13.1FWIW,但我以前的版本也有问题),我似乎找不到在Python模块上运行ASAN的方法(我非常怀疑这与Boost.Python,我想其他技术也一样)。这是一个简单的Python模块://hello_ext.cc#includecharconst*greet(){auto*res=newchar[100];std::strcpy(res,"Hello,wo

python - 地址清理 Boost.Python 模块

我的项目包括一个大型C++库和Python绑定(bind)(通过Boost.Python)。测试套件主要是在Python绑定(bind)之上编写的,我想使用sanitizer来运行它,从ASAN开始。我正在运行macOS(10.13.1FWIW,但我以前的版本也有问题),我似乎找不到在Python模块上运行ASAN的方法(我非常怀疑这与Boost.Python,我想其他技术也一样)。这是一个简单的Python模块://hello_ext.cc#includecharconst*greet(){auto*res=newchar[100];std::strcpy(res,"Hello,wo

python - 使用 boost::python vector_indexing_suite 包装 std::vector

我正在开发一个带有Python绑定(bind)(使用boost::python)的C++库,表示存储在文件中的数据。我的大多数半技术用户将使用Python与之交互,因此我需要使其尽可能Pythonic。不过,我也会让C++程序员使用API,所以我不想在C++方面妥协以适应Python绑定(bind)。图书馆的很大一部分将由容器组成。为了让python用户更直观,我希望他们表现得像python列表,即:#anexamplecompoundclassclassFoo:def__init__(self,_val):self.val=_val#addittoalistfoo=Foo(0.0)v

python - 使用 boost::python vector_indexing_suite 包装 std::vector

我正在开发一个带有Python绑定(bind)(使用boost::python)的C++库,表示存储在文件中的数据。我的大多数半技术用户将使用Python与之交互,因此我需要使其尽可能Pythonic。不过,我也会让C++程序员使用API,所以我不想在C++方面妥协以适应Python绑定(bind)。图书馆的很大一部分将由容器组成。为了让python用户更直观,我希望他们表现得像python列表,即:#anexamplecompoundclassclassFoo:def__init__(self,_val):self.val=_val#addittoalistfoo=Foo(0.0)v

c++ - 在 clang++ 中使用 boost/thread header 时遇到问题 (Windows)

我正在尝试使用clang++在Windows上使用Boost.Thread。在包含boost/thread.hpp时,我收到以下编译错误:使用-DBOOST_USE_WINDOWS_H:InfileincludedfromD:/env/boost/boost_1_58_0\boost/thread.hpp:13:InfileincludedfromD:/env/boost/boost_1_58_0\boost/thread/thread.hpp:12:InfileincludedfromD:/env/boost/boost_1_58_0\boost/thread/thread_only

c++ - 在 clang++ 中使用 boost/thread header 时遇到问题 (Windows)

我正在尝试使用clang++在Windows上使用Boost.Thread。在包含boost/thread.hpp时,我收到以下编译错误:使用-DBOOST_USE_WINDOWS_H:InfileincludedfromD:/env/boost/boost_1_58_0\boost/thread.hpp:13:InfileincludedfromD:/env/boost/boost_1_58_0\boost/thread/thread.hpp:12:InfileincludedfromD:/env/boost/boost_1_58_0\boost/thread/thread_only

c++ - BOOST_NO_EXCEPTIONS 是否保证与 -fno-exceptions 兼容?

我想将Boost.Filesystem与-fno-exceptions一起使用。根据Boost.Filesystemdocumentation它声明它支持BOOST_NO_EXCEPTIONS宏。但是,以下snippet:#defineBOOST_NO_EXCEPTIONS#includeintmain(){}编译:g++-fno-exceptionsboost_test.cpp给出错误:/.../boost/filesystem/operations.hpp:Inconstructor'boost::filesystem::filesystem_error::filesystem_e