boost

what is a good way to read STL and boost documentation in emacs?

hi I am familiar with using info and man commands in emacs, however boost and default STL do not come with man or info pages, instead they come as HTML documentation. especially boost does not seem to have any documentation besides HTML (I could be wrong). Right now I am trying to put together w3m for quick searching of boost and STL d...

How to build boost library and others against OS X 10.4u SDK on OS X 10.6?

Hello, I'm trying to build the boost libraries and others against the os x 10.4u.sdk so I can include them in a project targeting 10.4 upwards. I'm not entirely sure what to do, am I aiming to put the .dylibs in 10.4.sdk/usr/local/.. or in my default 10.6 /usr/local/.. with support for 10.4? Any help much appreciated. Toby. ...

boost::trim each string in std::vector<std::string>

I'm currently stuck finding the correct syntax for trimming each string in a std::vector. I tried std::vector<std::string> v; std::for_each(v.begin(), v.end(), &boost::trim); which gave me the following error messages in MSVC7.1. error C2784: '_Fn1 std::for_each(_InIt,_InIt,_Fn1)' : could not deduce template argument for 'T1' from ...

Boost Preprocessor library for generating a set of types based on a list of basic types e.g. PointI32, PointF32 etc. in C++/CLI

Hi, I am trying to figure out how to use the Boost.Preprocessor library http://www.boost.org/doc/libs/release/libs/preprocessor to unfold a "generic" type for different specific types. Below I will ask this for a simple point class example. Given: struct Point##TYPE_SUFFIX_NAME { TYPE X; TYPE Y; // Other code }; I want to...

Why doesn't boost::serialization check for tag names in XML archives?

I'm starting to use boost::serialization on XML archives. I can produce and read data, but when I hand-modify the XML and interchange two tags, it "fails to fail" (i.e. it proceeds happily). Here's a small, self-complete example showing what I see: #include <iostream> #include <fstream> #include <boost/archive/xml_oarchive.hpp> #includ...

Creating multicast events with std::tr1::function (or boost::function)

I'm attempting to create C#-like multicast delegates and events using features from TR1. Or Boost, since boost::function is (mostly) the same as std::tr1::function. As a proof of concept I tried this: template<typename T1> class Event { private: typedef std::tr1::function<void (T1)> action; std::list<action> callbacks; public: inli...

I've got Python built using VS2008, how do I install it?

I'm working with boost::python and wanted to build the whole thing to make sure I can pull it off. However, I don't see any install script or way to build the MSI so I can install it. Anyone know where the directions are? Or the projects I could use to make an MSI file? Doing this on linux seems trivial: make install How do I do th...

Initialization of list with for_each to random variables

I'm trying to initialize a list to random integers using a for_each and a lambda function. I'm new to boost.lambda functions so I may be using this incorrectly but the following code is producing a list of the same numbers. Every time I run it the number is different but everything in the list is the same: srand(time(0)); theList.resiz...

Where to find boost's skeleton for autopackage?

I'm using autopackage to create an installer. The installer contain binary files (closed source project). The project depends of some boost libraries (date_time, thread etc.). Other dependences work fine: require @haxx.se/libcurl 4 require @openssl.org/openssl 0.9 But I didn't found skeleton file(s) for boost libraries. Any ideas? ...

Find Boost BGL vertex by a key

Hi, I am looking for a way to access vertex properties by using a key instead of vertex reference itself. For example, if I have class Data { public: std::string name; unsigned int value; }; typedef boost::adjacency_list< boost::vecS, boost::vecS, boost::directedS, Data > Graph; typedef boost::graph_traits<Graph>::vertex_d...

iterator_range in header file

I want to specify in a header file that the input to a function will be an iterator_range, and the iterator can be dereferenced to obtain an int. What is the best way to do this? I do not want to say iterator_range<std::vector<int>::iterator> as this binds the implementation to use std::vector<int>. Would appreciate any ideas to specify...

boost local_date_time math wrong?

I'm using Boost's datetime library in my project. I was very happy when I discovered that it has time duration types for hours, days, months, years, etc, and they change their value based on what you're adding them to (i.e. adding 1 month advances the month part of the date, it doesn't just add 30 days or somesuch). I thought this prop...

Does using large libraries inherently make slower code?

I have a psychological tic which makes me reluctant to use large libraries (like GLib or Boost) in lower-level languages like C and C++. In my mind, I think: Well, this library has thousands of man hours put into it, and it's been created by people who know a lot more about the language than I ever will. Their authors and fan...

using setw with user-defined ostream operators

How do I make setw or something similar (boost format?) work with my user-defined ostream operators? setw only applies to the next element pushed to the stream. For example: cout << " approx: " << setw(10) << myX; where myX is of type X, and I have my own ostream& operator<<(ostream& os, const X &g) { return os << "(" << g.a...

c++ transform with if_then_else control structure

I'm trying to change the integer values in a vector using transform and an if_then_else control structure from Boost Lambda. However my compiler is not appreciating my efforts. The code I am attempting is: transform(theVec.begin(), theVec.end(), theVec.begin(), if_then_else(bind(rand) % ratio == 0, _1 = bind(rand) % maxSize, ...

How to use the boost lexical_cast library for just for checking input

I use the boost lexical_cast library for parsing text data into numeric values quite often. In several situations however, I only need to check if values are numeric; I don't actually need or use the conversion. So, I was thinking about writing a simple function to test if a string is a double: template<typename T> bool is_double(cons...

How can I use templated typedefs, that are _in_ a class, from outside the class (e.g. by another class), in relation to boost::graph

Hi, I found a very useful answer on how to create templated graphs using boost::graph under http://stackoverflow.com/questions/671714/modifying-vertex-properties-in-a-boostgraph/950173#950173 For me, this is very convenient as long as I do all the work on the graph in the Graph-class itself. However, it might be necessary to access in...

Boost random number generator

Does anyone have a favorite boost random number generator and can you explain a little on how to implement it into code. I am trying to get the mersenne twister to work and was wondering if anyone had preference towards one of the others. ...

Linking to boost_filesystem in a bjam-based project

I'm trying to set up Boost.Build for my own project, which references libboost_filesystem. When I run bjam release avg_asp I get the following output: andreas@rodin:~/src/libdoas/src/tools$ bjam release avg_asp -n /home/andreas/lib/build/boost_1_42_0/Jamroot:637: in modules.load rule targets.create-metatarget unknown in module Jamfi...

Combine boost::lexical_cast and std::transform

I would like to write something like this, which cannot be compiled: std::vector<A> as; std::vector<B> bs( as.size() ); std::transform( as.beginn(), as.end(), bs.begin(), boost::lexical_cast<B> ); But this is not working, so I created a functor which is doing this for me: template<typename Dest> struct lexical_transform { templat...