boost

How to erase elements from boost::ptr_vector

So I'm trying to get rid of my std::vector's by using boost::ptr_vector. Now I'm trying to remove an element from one, and have the removed element deleted as well. The most obvious thing to me was to do: class A { int m; }; boost::ptr_vector<A> vec; A* a = new A; vec.push_back(a); vec.erase(a); But this won't even compile (see below...

How Important is Boost to Learn for C++ Developers

I am curious to learn Boost. But i wanted to ask how important it is to learn. What pre-requisite one should need before jumping on Boost. Why i am curious to know about Boost is that many people are talking about Boost on IRC's channels and here in StackOverflow. Thanks in advance. ...

Which C++ signals/slots library should I choose?

I want to use a signals/slots library in a project that doesn't use QT. I have pretty basic requirements: Connect two functions with any number of parameters. Signals can be connected to multiple slots. Manual disconnection of signal/slot connection. Decent performance - the application is frame-based (e.g. not event-based) and I want...

Mixing Qt and Boost

I'm looking at starting a project in C++ using the Qt 4 framework (a cross-platform GUI is required). I've heard great things about the Boost libraries from friends and online. I've started reading up on both and wanted to ask a cursory question before I got too deep: Are these two development "systems" mutually exclusive? My initial...

Once you've adopted boost's smart pointers, is there any case where you use raw pointers?

I'm curious as I begin to adopt more of the boost idioms and what appears to be best practices I wonder at what point does my c++ even remotely look like the c++ of yesteryear, often found in typical examples and in the minds of those who've not been introduced to "Modern C++"? ...

Where can I get material for learning EBNF?

Extended Backus–Naur Form: EBNF I'm very new to parsing concepts. Where can I get sufficiently easy to read and follow material for writing a grammar for the boost::spirit library, which uses a grammar similar to EBNF? Currently I am looking into EBNF from Wikipedia. ...

boost spirit extracting first word and store it in a vector

Hi, I have problems with Boost.Spirit parsing a string. The string looks like name1 has this and that.\n name 2 has this and that.\n na me has this and that.\n and I have to extract the names. The text "has this and that" is always the same but the name can consist of spaces therefore I can't use graph_p. 1) How do I parse s...

How can I make Eclipse CDT auto-indent properly when using BOOST_FOREACH?

I write this tiny C++ example in Eclipse 3.4.1 (CDT 5.0.1): #include <iostream> #include <vector> #include <boost/foreach.hpp> int foo() { std::vector<int> numbers; BOOST_FOREACH(int n, numbers) { std::cout << n << std::endl; } std::cout << numbers.size << std::endl; } Then I hit Shift+Ctrl+F to format my code, and it b...

Best way for interprocess communication in C++

I have two processes one will query other for data.There will be huge amount of queries in a limited time (10000 per second) and data (>100 mb) will be transferred per second.Type of data will be an integral type(double,int) My question is in which way to connect this process? Shared memory , message queue , lpc(Local Procedure call) o...

Is there a standard C++ function object for taking apart a std::pair?

Does anyone know if there's a de-facto standard (i.e., TR1 or Boost) C++ function object for accessing the elements of a std::pair? Twice in the past 24 hours I've wished I had something like the keys function for Perl hashes. For example, it would be nice to run std::transform on a std::map object and dump all the keys (or values) to ...

What is Boost missing?

After spending most of my waking time on Stack Overflow, for better or for worse, I've come to notice how 99% of the C++ questions are answered with "use boost::wealreadysolvedyourproblem", but there must definitely be a few areas Boost doesn't cover, but would be better if it did. So what features is Boost missing? I'll start by s...

Boost.format and wide characters

Is there a way to get boost.format to use and return wide (Unicode) character strings? I'd like to be able to do things like: wcout << boost::format(L"...") % ... and wstring s = boost::str(boost::format(L"...") % ...) Is this possible? ...

Whats the deal with boost.asio and file i/o?

I've noticed that boost.asio has a lot of examples involving sockets, serial ports, and all sorts of non-file examples. Google hasn't really turned up a lot for me that mentions if asio is a good or valid approach for doing asynchronous file i/o. I've got gobs of data i'd like to write to disk asynchronously. This can be done with nativ...

How to learn boost

I've heard so many comments in SO and other places about boost libraries that I finally decided to learn them. Can anyone recommend me some tutorial or online book? ...

Is Boost guilty of being un-Boost-like?

I was just reading the intro to the Boost::Spirit LL Parser framework. The preface suggests that the author and creator likes to use such parsing technology to read in program options. Doesn't Boost have its own library for program options? I am wondering, does the Boost committee review all the library notes for common themes and style...

Do XCode projects need special settings to use pre-compiled boost libraries?

I have just installed boost for the first time on my Intel Mac, and it works fine in general, as long as I use only boost's header files. But when I try to use a lib, in my case the regex lib, my app links and launches fine, but then it soon crashes in a regex related destructor. This even happens with the simple test program that's gi...

lightweight boost::bind

I'm so sick of the pass-callback-data-as-void*-struct anti-pattern. Boost bind solves it nicely, but is an unacceptable dependency. What's a lightweight alternative? How would I write it myself as simply as possible? ...

Read\write boost::binary_oarchive to pipe.

Hello. I am continue to build two simple processes throwing class objects one to another (see my previous post) through simple (anonymous) pipes. Now I revealed for myself boost::serialization (thanks answered people) and have tried to make some class be serialized through ::WriteFile\::ReadFile. So - what I am doing wrong? 1) I creat...

C++ associative array with arbitrary types for values

What is the best way to have an associative array with arbitrary value types for each key in C++? Currently my plan is to create a "value" class with member variables of the types I will be expecting. For example: class Value { int iValue; Value(int v) { iValue = v; } std::string sValue; Value(std::string v) { sValue ...

Trying to get rid of a c++ boost warning

Whenever I include boost in my project I get a million of these warnings. Does anyone know how I can get rid of the warnings? ../depends\boost/config/abi_prefix.hpp(19) : warning C4103: 'depends\boost\config\abi_prefix.hpp' : alignment changed after including header, may be due to missing #pragma pack(pop) I know I can d...