boost

Deserializing STL container of type with no default constructor

生来就可爱ヽ(ⅴ<●) 提交于 2020-01-17 05:13:05
问题 I've recently learned the pattern of the deserializing constructor (Deserializing constructor doesn't read data correctly) to use serialization with types that do not have default constructors. Now I'm trying to serialize an STL container of these objects, as in the example below: #include <boost/archive/text_oarchive.hpp> #include <boost/archive/text_iarchive.hpp> #include <boost/serialization/split_member.hpp> #include <boost/serialization/vector.hpp> #include <fstream> class Point { public

boost geometry precision loss

人走茶凉 提交于 2020-01-17 04:49:07
问题 #include <iostream> #include <vector> #include <boost/geometry.hpp> #include <boost/geometry/strategies/cartesian/distance_pythagoras.hpp> #include <boost/geometry/geometries/point_xy.hpp> #include <boost/geometry/geometries/polygon.hpp> #include <boost/geometry/geometries/linestring.hpp> #include <boost/geometry/multi/geometries/multi_polygon.hpp> #include <boost/geometry/io/wkt/wkt.hpp> #include <boost/foreach.hpp> int main(int argc, char *argv[]) { typedef boost::geometry::model::d2::point

Boost: what could be the reasons for a crash in boost::slot<>::~slot?

人盡茶涼 提交于 2020-01-17 04:32:06
问题 I am getting such a crash: #0 0x90b05955 in __gnu_debug::_Safe_iterator_base::_M_detach #1 0x90b059ce in __gnu_debug::_Safe_iterator_base::_M_attach #2 0x90b05afa in __gnu_debug::_Safe_sequence_base::_M_detach_all #3 0x000bc54f in __gnu_debug::_Safe_sequence_base::~_Safe_sequence_base at safe_base.h:170 #4 0x000aac05 in __gnu_debug::_Safe_sequence<__gnu_debug_def::vector<boost::signals::trackable const*, std::allocator<boost::signals::trackable const*> > >::~_Safe_sequence at safe_sequence.h

Cannot build Boost with Visual Studio 2017

爱⌒轻易说出口 提交于 2020-01-17 03:49:26
问题 I downloaded Boost 1.63.0 and tried building it with my newly installed Visual Studio 2017 but there is no way it works! It compiles with the Visual Studio 2015 compiler instead. Let me be more clear. I have both Visual Studio 2015 Update 3 and Visual Studio 2017 installed in my laptop. I open a command prompt with the environment set for the 2017 compiler (which is version 15.0). Then I execute: b2 --layout=versioned --with-chrono but it uses version 14.0 (toolset=msvc-14.0) instead of

How to restore brew formula after I rm it

蓝咒 提交于 2020-01-17 03:36:07
问题 I just rm a formula in tap homebrew/homebrew-core which is boost-python and boost since they seem to be broken. I want to delete them and retap them again. What I have tried: brew tap --repair and brew tap homebrew/homebrew-core But they didn't work. What should I do to get these formulas back? https://github.com/Homebrew/homebrew-core/blob/master/Formula/boost-python.rb https://github.com/Homebrew/homebrew-core/blob/master/Formula/boost.rb 回答1: The way to fix it is directly installing a

Why does it look like boost::shared_ptr constructions are getting slower?

时光毁灭记忆、已成空白 提交于 2020-01-17 03:04:37
问题 I have a problem with boost shared_ptr. The initialization time of the smart pointer in the cycle is increased after the first iteration. The first iteration takes 40 msec. Every other iteration takes about 400 msec. I have no idea why it happens. I checked and there are no memory leaks and all destructors are called. Does anyone have a solution of this case? PS. However, when I use the boost::ptr_vector, the time is not increased( but only in debug version :) ). See example: class A; typedef

Why does it look like boost::shared_ptr constructions are getting slower?

穿精又带淫゛_ 提交于 2020-01-17 03:03:26
问题 I have a problem with boost shared_ptr. The initialization time of the smart pointer in the cycle is increased after the first iteration. The first iteration takes 40 msec. Every other iteration takes about 400 msec. I have no idea why it happens. I checked and there are no memory leaks and all destructors are called. Does anyone have a solution of this case? PS. However, when I use the boost::ptr_vector, the time is not increased( but only in debug version :) ). See example: class A; typedef

Boost Interprocess named_mutex semaphore file permissions [duplicate]

佐手、 提交于 2020-01-17 00:41:56
问题 This question already has answers here : POSIX shared memory and semaphores permissions set incorrectly by open calls (2 answers) Closed 2 years ago . I am creating my shared memory using the below, trying either to open or create and setting unrestricted permissions. void createMemory(const int numBytes) { permissions perm; perm.set_unrestricted(); segment.reset(new managed_shared_memory(open_or_create, memory_name, numBytes, 0, perm)); // Exception throw on this line mutex.reset(new named

boost asio acceptor.accept invalid argument

大兔子大兔子 提交于 2020-01-16 18:01:32
问题 i am trying to code with boost asio in socket programming. after setting boost in my ubuntu eclipse environment, i tried the sample code in boost web site. but an error occur on acceptor.accept() function with invalid argument, like below how can i fix this error ? Invalid arguments ' Candidates are: void accept(boost::asio::basic_socket<#10000,#10001> &, std::enable_if<&0[std::is_convertible<boost::asio::ip::tcp,#10000>::value],void>::type *) boost::system::error_code accept(boost::asio:

boost asio acceptor.accept invalid argument

荒凉一梦 提交于 2020-01-16 18:01:24
问题 i am trying to code with boost asio in socket programming. after setting boost in my ubuntu eclipse environment, i tried the sample code in boost web site. but an error occur on acceptor.accept() function with invalid argument, like below how can i fix this error ? Invalid arguments ' Candidates are: void accept(boost::asio::basic_socket<#10000,#10001> &, std::enable_if<&0[std::is_convertible<boost::asio::ip::tcp,#10000>::value],void>::type *) boost::system::error_code accept(boost::asio: