boost

Howto incorporate -I in makefile

Dear all, I have no problem compiling specific code the following way: g++ -I /opt/local/include Code1.cc -o Code1 However when I tried to do that in the makefile: CXX = g++ -Wall -Werror -gstabs -pedantic -O2 -g all: Code3 Code2 Code1 Code3: Code3.cc Tools.cc $(CXX) $^ -o $@ Code2: Code2.cc Tools.cc $(CXX) $^ -o $@ ...

Dynamically change allocation strategy in boost::vector and boost::matrix

Hi, In my new project i am building a data management module.I want to give a simple template storage type to upper layers like template<typename T> class Data { public: T getValue(); private: boost::numeric::ublas::matrix<T> data; } My aim is, to change allocator of data with some different allocators like Boost.inter process...

Is there a way to get Asio working without Boost?

I know there is a version of ASIO that is not included in the Boost namespace, but even then ASIO depends on Boost, but I'm wondering if there is a way to get ASIO to work without dependencies on Boost (because I cannot include Boost into the project, for too many reasons). ...

Boost Deserialization Optimizations?

I'm deserializing a fair amount of data through Boost.Serialization (one for each frame). However, when I output how long the deserialization takes, it varies wildly. It is not unusably slow at the moment, but it would be nice to make it faster. The data represents the same classes, arrays, maps and vectors but merely with different valu...

How much of C++ is supported in Objective-C++

I want to make an iPhone app, but I am planning to make the framework in C++. Is it possible to use things like templates in Objective-C++. I guess really the question is, can I use boost? ...

Help storing an intrusive_ptr of a template class in a std::map

I have a small template class of type Locker contained within a boost::intrusive_ptr that I want to store inside a std::map: template <typename T> bool LockerManager<T>:: AddData(const std::string& id, T* pData) { boost::intrusive_ptr<Locker<T> > lPtr(Locker<T>(pData)); // Line 359 - compiles mMap.insert(make_pair(id, lPtr)); /...

std::set filled with boost::variant elements cannot be sorted descendantly ??

typedef boost::variant<long long,double,string> possibleTypes ; set<possibleTypes,less<possibleTypes> > ascSet ; set<possibleTypes,greater<possibleTypes> > descSet ; When I try to compile I get a bunch of errors in some library headers. But, if I remove the third line (the one with descSet ) the code compile just fine. What's the pro...

Compiling C++ Code With Boost's regex_match

Given this code: #include <iostream> #include <vector> #include <fstream> #include <sstream> #include <boost/regex.hpp> using namespace std; using namespace boost; int main ( int arg_count, char *arg_vec[] ) { if (arg_count !=2 ) { cerr << "expected one argument" << endl; return EXIT_FAILURE; } string ...

Case Sensitive Partial Match with Boost's Regex

Dear all, From the following code, I expect to get this output from the corresponding input: Input: FOO Output: Match Input: FOOBAR Output: Match Input: BAR Output: No Match Input: fOOBar Output: No Match But why it gives "No Match" for input FOOBAR? #include <iostream> #include <vector> #include <fstream> #include <sstrea...

Can I silence boost's configure script?

When I'm installing boost (running .configure) it lists every file that is copied in the install process. Is there any way to silence this? ...

Do I need to run Boost's configure script to build libraries (e.g. graph, test)?

If I don't want to install Boost but I want to build one of the libraries (i.e. BGL, for using graphml) is there a way to build the library in a system independent manner without running .configure? ...

Boost is just great and free ... Is there a catch?

The reason for this, I find myself being asked to make replacement classes for boost's classes in a commercial project. And I am asked to test them against the boost class's behaviour. This makes absolutely no sense to me. I seldom see a license as open as boost's. Maybe there will be added functionality in the future, but since boost'...

boost version in linux distros

Hello! Does anybody know the reason why fedora 10 (quite a modern linux distro I'd say) still shipped with boost version 1.34, while latest release is 1.38 ? ...

ACE vs Boost vs Poco vs wxWidgets

I have a considerable amount of experience with ACE, Boost and wxWidgets. I have recently found the POCO libraries. Does anyone have any experience with them and how they compare to ACE, Boost and wxWidgets with regard to performance and reliability? I am particularly interested in replacing ACE with POCO. I have been unable to get A...

template specialization for static member functions; howto?

I am trying to implement a template function with handles void differently using template specialization. The following code gives me an "Explicit specialization in non-namespace scope" in gcc: template <typename T> static T safeGuiCall(boost::function<T ()> _f) { if (_f.empty()) throw GuiException("Function pointer empty"); { Th...

How to use BOOST_FOREACH with two std::maps?

I have code that looks essentially like this: std::map<int, int> map1, map2; BOOST_FOREACH(int i, map1) { // do steps 1-5 here... } BOOST_FOREACH(int i, map2) { // do steps 1-5 (identical to above) here... } Is there any way to concatenate the maps to eliminate the duplicate code in the second loop? Or a way to extend BOOST_FO...

tr1::hash for boost::thread::id?

Dear all: I started to use the unordered_set class from the tr1 namespace to speed-up access against the plain (tree-based) STL map. However, I wanted to store references to threads ID in boost (boost::thread::id), and realized that the API of those identifiers is so opaque that you cannot clearly obtain a hash of it. Surprisingly, boo...

element-wise operations with boost c++ ublas matrix and vector types

i'd like to perform element-wise functions on boost matrix and vector types, e.g. take the logarithm of each element, exponentiate each element, apply special functions, such as gamma and digamma, etc. (similar to matlab's treatment of these functions applied to matrices and vectors.) i suppose writing a helper function that brute-force...

C++ Letting a boost thread wait for 1 second

I have created a boost thread using: boost::thread thrd(&connectionThread); where connectionThread is a simple void function. This works fine, however, when I try to make it wait for some seconds, for example using: boost::xtime xt; boost::xtime_get(&xt, boost::TIME_UTC); xt.sec += 1; boost::thread::sleep(xt); // Sleep for 1 second ...

Equivalent of CppUnit protectors for boost::test ?

I've used both CppUnit and boost::test for C++ unittesting. Generally I prefer boost::test, mainly because the auto-test macros minimise the effort to setup tests. But there's one thing I really miss from CppUnit: the ability to register your own "protectors", instances of which automatically wrap all the run tests. (Technically, you ...