boost

Boost Asio problems, Server-Client, Slow on a real network?

I have created a client-server architecture using Boost Asio. The entire thing works, I can send and receive messages, etc, so there is no question about the correctness. However, when I implement it in a real network, all of a sudden it becomes VERY slow. When I run the server and client on the same computer itgoes blazingly fast, but ...

C++ boost date format

Hi, I have a vector string of dates in the from "dd-mmm-yyyy" so for example todays date would be: std::string today("07-Sep-2010"); I'd like to use the date class in boost but to create a date object the constructor for date needs to be called as follows: date test(2010,Sep,07); Is there any easy/elegant way of passing da...

`bjam --toolset=` and tag values for Apple compilers?

When building Boost binary libraries with bjam, one may specify which compiler to use, without specifying a particular compiler version, by using certain values for the --toolset= option. For example: bjam --with-serialization --toolset=msvc the toolset value msvc tells bjam to search your system for some version of Microsoft Visual C...

Boost memory map specifying readahead.

Is there an option in boost memory maps that forces it to start bringing the entire file into memory without pagefaulting first? Is that operating system dependent or is will it be mostly portable? I need to bring entire files into memory and while I don't care about the actual contents I am concerned by the time it takes. I kind of don'...

How can I extract double pairs from an std::string with Boost Spirit?

I want to parse a string with a sequence of double pairs into an std::map with Boost Spirit. I adapted the example from http://svn.boost.org/svn/boost/trunk/libs/spirit/example/qi/key_value_sequence.cpp but I have a problem with difining a proper qi::rule for key and value: template <typename Iterator> struct keys_and_values : qi::gra...

Building Boost Libs

Hi, About 3 months ago I managed to build boost libs and left myself the following instructions: Extract boost to -> cd C:\Program Files\boost\boost_1_43_0 Build bjam -> bootstrap.bat Issue the following command -> bjam --toolset=msvc-9.0 stage variant=debug threading=multi link=static runtime-link=static --with-filesystem --wit...

Can we use "Boost" librarys in our own librarys compiled under CLR?

So it is easy to create a win 32 project and use boost. I did not tried it yet but I plan to. I wonder If I can use boost in CLR mode. Is it possible? Has any one tried? ...

Compilation of large class hierarchy consumes lots of memory after adding boost::serialization

We needed serialization of quite large C++ class hierarchy with lots of inheritance, contraction, shared pointers, etc. I decided to use boost::serialization library. My problem is that while compilation of this library on VS 2008 cl takes over 1 GB of RAM memory. I suppose this is caused by template-based serialization in Boost. This c...

How to create a boost ssl iostream?

I'm adding HTTPS support to code that does input and output using boost tcp::iostream (acting as an HTTP server). I've found examples (and have a working toy HTTPS server) that do SSL input/output using boost::asio::read/boost::asio::write, but none that use iostreams and the << >> operators. How do I turn an ssl::stream into an iostre...

How to distinct read / write operation in boost serialization?

Using the boost serialization library I have a very simple serialize() member function, something like: template <class Archive> void serialize( Archive& ar, unsigned version ) { ar & m_Searcher; } ... and I want to keep it such simple (I don't want to use splitting in particular). But in a case of writing I want to do some...

What if I don't join thread on "destruction" in release builds?

In many cases I have classes that act like active objects (have a thread). And to avoid access violations I always have to wait for join in the destructor. Which is usually not a problem. However imagine a release build with some bug (deadlock, livelock etc.) that causes join() not to return on time or at all, this would cause the enti...

Cygwin boost comes with new g++ which seems to break my code... why?

Setup: I installed Cygwin with the GNU programming lineup (gcc, g++, make, and gdb) and successfully compiled an ran a program that I was working on. Then I decided to install boost into Cygwin because I will need to use typical boost stuff as my program develops. So, using the Cywing setup.exe, I installed boost. After this, the pro...

How can I serialize std::type_info using Boost serialization?

I want to record the std::type_info of a variable so that on load I will be able to re-create the appropriate type variable. Saving will look like this: friend class boost::serialization::access; template<class Archive> void save(Archive & ar, const unsigned int version) const { ... ar & BOOST_SERIALIZATION_NVP(typeid(value)); ...

How to create analog for such C# StreamProxyApplication function in C++ using Boost library?

I haven't done work in C/C++ for a little bit and was just wondering if any one can help me with porting this .Net C# code into C++ using Boost library (Boost.Asio) So I have one function: private const int bufferSize = 8192; /// <summary> /// The entry point of the application. /// </summary> /// <param name="args">The input argumen...

boost::regex behaving differently on debug and release builds

boost::regex re("^\\s*([_\\w\\.]+)\\s*=\\s*([^\\s]+)$"); if(re.empty()){ std::cout<<"How is this possible?"<<std::endl; } That line prints in my release builds! (The debug builds are fine) Working with MSVC 2008 (vc 9.0) Compiler options for DEBUG: /Od /I "C:\Program Files\boost\boost_1_44_0" /I "C:\gtest-1.5.0\include" /I "includ...

how to get type of variable?

Hi all! example: template<typename T> struct type_of { typedef boost::mpl::if_<boost::is_pointer<T>, typename boost::remove_pointer<T>::type, T >::type type; }; int main() { int* ip; type_of<ip>::type iv = 3; // error: 'ip' cannot appear in a constant-expression } thenks! ...

How do Boost Bind, Boost Function, Boost Signals and C++ function pointers all relate to each other?

As the title might convey, I'm having problems seeing how Boost Bind, Boost Function, Boost Signals and C++ function pointers all play together. From my understanding, Boost Bind and Boost Function in conjunction work like Signals while Signals is an abstraction above Bind and Function. Also, compared to standard C++ function pointers...

C++ template metaprogramming to create a boost::variant from a shared_ptr and a boost::static_visitor

As a personal exercise, I want to implement the visitor pattern using shared_ptr. I am familiar with Robert Martin's acyclic visitor paper but find the intrusive nature of the virtual accept() and necessary creation of an {X}Visitor class for each {X} class unpleasant. I like the boost::static_visitor class as it encapsulates all the l...

Help on using boost relaxed heap

Hello all, I'm implementing a few graph algorithms at the moment and am wanting a container with the complexity of a fibonacci heap or a relaxed heap (specifically I want at least O(logN) for push and pop and O(1) for reduce_key). I'm not keen on implementing this myself if at all possible (development and testing overhead and time) an...

How to use boost::unit_test?

I'm trying to learn how to test programs so I tried Boost. I've started reading it and here I've met this line: Now I can compile it and link with the unit test framework. From where and how am I suppose to get unit test framework? And what it is? I just do not know what to eat it with. Could someone please provide some steps how to ...