boost

Problem with building Boost Graph Library Python bindings under Leopard

I've inherited some Python code which is importing boost.graph and I'm having an issue setting up the following under Mac OS X Leopard (I believe this is what I need to install to get it working): http://osl.iu.edu/~dgregor/bgl-python/ According to the readme I need to build with bjam, but I see the following error: [matt@imac ~/Downl...

How many threads does it take to make them a bad choice?

I have to write a not-so-large program in C++, using boost::thread. The problem at hand, is to process a large (maybe thousands or tens of thousands. Hundreds and millons are a possibility as well) number of (possibly) large files. Each file is independent from another, and they all reside in the same directory. I´m thinking of using th...

Boost advocacy - help needed.

Possible duplicates Is there a reason to not use Boost? What are the advantages of using the C++ BOOST libraries? OK, the high-level question is "Please provide me with what you consider to be the most effective arguments of why entire Boost, or some specific parts of it, should be compiled on our company's system and endorsed i...

Cross-platform developement?

I am looking for a solution which would allow me to code for Linux and Windows using C++. On Windows I use Visual Studio (I tried other stuff on Windows but I work with DirectX and as far as I know, it's the best solution). On Linux I use NetBeans (which I like very much). My problem is that I want the project be independent of Visual...

Initializing a polygon in boost::geometry

I am new to the generic geometry library that is proposed for inclusion with boost: http://geometrylibrary.geodan.nl/ I have two vectors vector<int> Xb, Yb that I am trying to create a polygon from. I am trying to get something along the lines of the following code snippet: polygon_2d P; vector<double>::const_iterator xi; vector<...

Intel compiler does not compile private forward class declaration in another class

Hi there, I've some problems with intel compiler 11.1.xxx Those problems doesn't appears during compilation with MS CL compiler. And I don't udnerstand what's wrong with the code (external boost library header) I end up with multiple errors: ..\boost/log/attributes/attribute_set.hpp(148): error: declaration is incompatible ...

Boost.Build best practice to introduct a pre-built libary to the project

We currently use the `lib' like this to introduce an external pre-built library into a project: lib ace_lib_static : : <name>libboost_ace-vc80-mt-sgd.lib <variant>debug <toolset>msvc <address-model>64 <search>../lib/ACE_wrappers/lib64 ; lib ace_lib_static : : <name>libboost_ace-vc80-mt-s.lib <variant>rele...

Threading a member function inside a vector of classes

Hello, consider this: class MyClass { public: void DoSomething() { }; }; std::vector<MyClass> A; int main(int argc, char* const argv[]) { MyClass a; A.push_back(a); boost::thread newThread(&MyClass::DoSomething, &A.back()); } It compiles, but, expectedly, it does not work. Any help? ...

Accessing a nested pair

To take apart a pair, the following can be done boost::bind(&std::pair::second, _1); // returns the value of a pair What about using combinations of different containers, how can a nested pair be accessed? For example when I wanted to partition a vector into items contained in a supplemental map and items that where not contained in ...

Path Simplification/Reduction

I'm writing some code to manage a custom on disk file structure and syncronize it to unconnected systems. One of my requirements is to be able to estimate the size of a sync prior to actually generating the sync content. As a simple solution, I've put together a map with full path filenames as the key for effecient lookup of already sc...

boost scoped_lock. Will this lock?

solved I changed the bfs::directory_iterator Queue to a std::string queue, and surprisingly solved the problem. Hi, I have a gut feeling that i'm doing things wrong. I've implemented (or attempted to) the thread pool pattern. N threads read from a Queue, but i'm having some trouble. Here's what i got: //inside a while loop bool isE...

Encapsulated boost thread_group. Questions about ids and synchronization.

Hi, I´m using a class that encapsulates a thread_group, and have some questions about it class MyGroup{ private: boost::this_thread::id _id; boost::thread::thread_group group; int abc; //other attributes public: void foo(); }; In the class constructor, i launch N threads for (size_t i=0;i<N;i++){ g...

How do you use a variable stored in a boost spirit closure as input to a boost spirit loop parser?

I would like to use a parsed value as the input to a loop parser. The grammar defines a header that specifies the (variable) size of the following string. For example, say the following string is the input to some parser. 12\r\nTest Payload The parser should extract the 12, convert it to an unsigned int and then read twelve char...

Setting thread priority in Linux with Boost

The Boost Libraries don't seem to have a device for setting a thread's priority. Would this be the best code to use on Linux or is there a better method? boost::thread myThread( MyFunction() ); struct sched_param param; param.sched_priority = 90; pthread_attr_setschedparam( myThread.native_handle(), SCHED_RR, &param); I don't have al...

Memory leaks detection while using Boost

Hello, I would like to get the memory leaks information using _CRTDBG_MAP_ALLOC, and especially the files and line numbers, but I don't get them at the end. I only get something like this: {130} normal block at 0x00695128, 16 bytes long. Data: <\ E Pi > 5C A5 45 01 02 00 00 00 01 00 00 00 E8 50 69 00 I've seen that th...

Multiple threads for multiple ports?

Hello, To start off, I don't know very much about network programming... So given that, I have a program (process) which needs to listen on 3 ports... Two are TCP and the other UDP. The two TCP ports are going to be receiving large amounts of data every so often (could be as little as every 5 minutes or as often as every 20 seconds...

Manually incrementing and decrementing a boost::shared_ptr?

Is there a way to manually increment and decrement the count of a shared_ptr in C++? The problem that I am trying to solve is as follows. I am writing a library in C++ but the interface has to be in pure C. Internally, I would like to use shared_ptr to simplify memory management while preserving the ability to pass a raw pointer through...

Why do Boost Parameter elected inheritance rather than composition?

I suppose most of the persons on this site will agree that implementation can be outsourced in two ways: private inheritance composition Inheritance is most often abused. Notably, public inheritance is often used when another form or inheritance could have been better and in general one should use composition rather than private inhe...

best lib for vector array in c++

I have to do calculation on array of 1,2,3...9 dimensional vectors, and the number of those vectors varies significantly (say from 100 to up to couple of millions). Of course, it would be great if the data container can be easily decomposed to enable parallel algorithms. I came across blitz++(almost impossible to compile for me), but a...

Is it possible to generate types with all combinations of template arguments?

I have a templated class template<class U, class V, class W> class S { //... implementations }; and some stock type implementations for type U, V and W: typedef boost::mpl::vector<U0, U1> u_types; typedef boost::mpl::vector<V0, V1, V2, V3, V4> u_types; typedef boost::mpl::vector<W0, W1, W2, W3, W4> w_types; I want to test class S...