Advertising

Archive for April, 2010

Download bzip2 library from bzip.org. Unpack it to c:\lib\bzip2-1.0.5 (in example). Compile boost lib with bzip2 support c:\lib\boost_1_42_0>bjam –without-python –without-mpi -sBZIP2_INCLUDE=c:\lib\bzip2-1.0.5 -sBZIP2_LIBPATH=c:\lib\bzip2-1.0.5 -sBZIP2_SOURCE=c:\lib\bzip2-1.0.5 -sBZIP2_BINARY=libbz2.lib variant=release link=static –toolset=msvc threading=multi –build-type=complete stage Let’s write some code #define BOOST_HAS_HASH   #include <boost/serialization/hash_map.hpp> #include <boost/archive/binary_oarchive.hpp> #include <hash_map> #include <fstream> #include <string> #include <boost/iostreams/filtering_streambuf.hpp> #include <boost/iostreams/filter/bzip2.hpp>   int _tmain(int argc, [...]

How to serialize hash_map with boost. All we know that hash_map is non-standart feature and it’s not in STL. Therefore, hash_maps is supported with stdext, __gnu_cxx namespaces etc. As hash_maps is non-standart feature of STL, there is some troubles on (de)serialize it. #define BOOST_HAS_HASH   #include <boost/serialization/hash_map.hpp> #include <boost/archive/binary_oarchive.hpp> #include <hash_map> #include <fstream> #include <string> [...]

Tags: , ,

Story that Chuck Swindol told on the radio… A little boy was out on the seashore picking up starfish and throwing them back into the water one at a time. The beach was covered with more starfish than the boy could possibly throw back in. A man approached the little boy and asked him “why [...]