boost

What is a jamfile?

寵の児 提交于 2021-01-27 01:38:46
问题 I'm trying to use the boost_1_55_0 libraries and I keep coming across references to jamfiles. What are jamfiles? Why are there things like bjam and multiple versions of jamfiles? 回答1: Jam is an open source make system built by Perforce. Bjam is a boost variant of jam. One of the advantages of jam is that it is explicitly designed to be a platform independent build system, in contrast to other build systems such as make. 来源: https://stackoverflow.com/questions/22901555/what-is-a-jamfile

What is a jamfile?

安稳与你 提交于 2021-01-27 01:38:29
问题 I'm trying to use the boost_1_55_0 libraries and I keep coming across references to jamfiles. What are jamfiles? Why are there things like bjam and multiple versions of jamfiles? 回答1: Jam is an open source make system built by Perforce. Bjam is a boost variant of jam. One of the advantages of jam is that it is explicitly designed to be a platform independent build system, in contrast to other build systems such as make. 来源: https://stackoverflow.com/questions/22901555/what-is-a-jamfile

Boost 1.65.1 geometry distance strategy compile error with Visual Studio 2017

倾然丶 夕夏残阳落幕 提交于 2021-01-26 09:38:13
问题 When trying to compile my project with new version of boost 1.65.1, I get the following error: C:\Users\twozn\Dev\soundtoolkit\stk\libraries\boost/geometry/strategies/distance.hpp(101): error C2664: 'int boost::mpl::assertion_failed<false>(boost::mpl::assert<false>::type)': cannot convert argument 1 from 'boost::mpl::failed ************(__cdecl boost::geometry::strategy::distance::services::default_strategy<boost::geometry::point_tag,boost::geometry::segment_tag,boost::geometry::model::point

Why boost::bind insists pulling `boost::placeholders` into global namespace?

こ雲淡風輕ζ 提交于 2021-01-26 07:31:08
问题 The following code can be fixed easily, but quite annoying. #include <functional> #include <boost/bind.hpp> void foo() { using namespace std::placeholders; std::bind(_1, _2, _3); // ambiguous } There's a macro BOOST_BIND_NO_PLACEHOLDERS , but using this macro will also bring some drawbacks like causing boost::placeholders disappear from the compile unit included <boost/bind.hpp> but not included <boost/bind/placeholders.hpp> . The name conflicts also comes with other libs like boost::mpl , I

Why boost::bind insists pulling `boost::placeholders` into global namespace?

社会主义新天地 提交于 2021-01-26 07:30:25
问题 The following code can be fixed easily, but quite annoying. #include <functional> #include <boost/bind.hpp> void foo() { using namespace std::placeholders; std::bind(_1, _2, _3); // ambiguous } There's a macro BOOST_BIND_NO_PLACEHOLDERS , but using this macro will also bring some drawbacks like causing boost::placeholders disappear from the compile unit included <boost/bind.hpp> but not included <boost/bind/placeholders.hpp> . The name conflicts also comes with other libs like boost::mpl , I

Reading and writing files with boost iostream socket

眉间皱痕 提交于 2021-01-21 09:22:17
问题 I'm trying to send and receive files using boost iostream sockets. what is the most efficient way to read the contents of the file and then send to stream? And how to read this content on the server side and write to file? Send: boost::asio::io_service svc; using boost::asio::ip::tcp; tcp::iostream sockstream(tcp::resolver::query{ "127.0.0.1", "3780" }); std::ifstream fs; fs.open("img.jpg", std::ios::binary); sockstream << // send file to stream Receive: boost::asio::io_service ios; boost:

Reading and writing files with boost iostream socket

大憨熊 提交于 2021-01-21 09:21:12
问题 I'm trying to send and receive files using boost iostream sockets. what is the most efficient way to read the contents of the file and then send to stream? And how to read this content on the server side and write to file? Send: boost::asio::io_service svc; using boost::asio::ip::tcp; tcp::iostream sockstream(tcp::resolver::query{ "127.0.0.1", "3780" }); std::ifstream fs; fs.open("img.jpg", std::ios::binary); sockstream << // send file to stream Receive: boost::asio::io_service ios; boost:

c++ and boost program_options error: 'desc' does not name a type

徘徊边缘 提交于 2021-01-20 09:14:35
问题 I'm trying to follow this tutorial on boost program_options, but I'm getting this error: error: 'desc' does not name a type. Here is the source code I have: #include <boost/program_options.hpp> using namespace std; namespace po = boost::program_options; po::options_description desc("Allowed options"); desc.add_options() ("help", "produce help message") ("compression", po::value<int>(), "set compression level") ; int main() { return 0; } the error is on the line starting with 'desc.add_options

c++ and boost program_options error: 'desc' does not name a type

女生的网名这么多〃 提交于 2021-01-20 09:10:33
问题 I'm trying to follow this tutorial on boost program_options, but I'm getting this error: error: 'desc' does not name a type. Here is the source code I have: #include <boost/program_options.hpp> using namespace std; namespace po = boost::program_options; po::options_description desc("Allowed options"); desc.add_options() ("help", "produce help message") ("compression", po::value<int>(), "set compression level") ; int main() { return 0; } the error is on the line starting with 'desc.add_options

Boost bimap fails to compile with gcc 10, c++20. Looking for temporary fix

无人久伴 提交于 2021-01-19 05:46:29
问题 With gcc 10.1 and boost 1.73.0, the following code #include <boost/bimap.hpp> int main() { boost::bimap<int, int> lookup; } fails to compile with flags -O2 --std=c++20 , but will succeed with flags -O2 -std=c++17 (verified with compiler explorer). This is possibly related to the following issue: https://github.com/boostorg/bimap/pull/15 (deprecated std::allocator<void> ) Is there some workaround I can use for now to get this code to successfully compile with --std=c++20 ? 回答1: The reason