[C++] Do you use Boost?

Started by
24 comments, last by Baraclese 18 years, 10 months ago
I've been looking at Boost library, particularly the implementation of multidimensional arrays: http://www.boost.org/libs/multi_array/doc/user.html I was contemplating using a nested vector, but this quote caught my eye:
Quote: Boost MultiArray is a more efficient and convenient way to express N-dimensional arrays than existing alternatives (especially the std::vector<std::vector<...>> formulation of N-dimensional arrays).
... being better then the stl is quite a bold claim. But the examples seem compelling. The licence seems pretty unrestrictive too. I'm looking for developers comments whom have actually used the library and if they like it or not, or had any problems. Thanks, Paul
Anything posted is personal opinion which does not in anyway reflect or represent my employer. Any code and opinion is expressed “as is” and used at your own risk – it does not constitute a legal relationship of any kind.
Advertisement
I've not used MultiArray but boost is useful. I've found boost::smart_ptr, function, bind, thread and signals very helpful.

Most C++ programmers know the library and its classes are almost a standard way to do things, in a similar way to the STL. If you're going to write something from scratch its best to check boost for something that fits your needs first.
The Boost libraries are widely used and quite well regarded. A fair number of the Boost libraries are currently under review for being added as part of the official C++ standard, so they'd actually become part of the STL. Their multi-dimentional array would be more efficient than the vector of vectors solution, because a vector of vectors has an extra pointer to dereference, while a true multidimentional array would not.

Personally, I have yet to use one of the Boost libraries, but I don't expect that to last long. I'm familiar with the libraries they offer, and when I encounter a problem where I feel one of their libraries would be of benefit, I'll use it, unless I have some reason for wanting to implement it myself.
I haven't used multiarray, but I use other boost libraries all the time. Many boost libraries should be a part of C++ standard and some possibly will be in the future. The STL is quite limited in many ways and boost patches up many of the holes in it.

As an added bonus, many boost libraries are header only, so you don't even have to worry about linking to the library, which can be useful if you're working on a multiplatform project.

okay props to all that replied, seems the feeling is generally good towards boost so I'll download it and take a look.

Signed, Paul
Anything posted is personal opinion which does not in anyway reflect or represent my employer. Any code and opinion is expressed “as is” and used at your own risk – it does not constitute a legal relationship of any kind.
Still haven't got boost to install correctly, but I would use it if I could.
-Lord Maz-
Quote:Original post by Lord Maz
Still haven't got boost to install correctly, but I would use it if I could.


Use bjam -sTOOLS=mingw [libname] on MinGW. There are different settings depending on your compiler and platform
Quote:Original post by Lord Maz
Still haven't got boost to install correctly, but I would use it if I could.


The installation does seem to have many steps - I've downloaded it and will use it if there is a bigger need. The exe extractor didn't work for me so I've downloaded the zip.

For the moment the yucky embedded vector solution is alright... if it annoys me further I'll use boost.
Anything posted is personal opinion which does not in anyway reflect or represent my employer. Any code and opinion is expressed “as is” and used at your own risk – it does not constitute a legal relationship of any kind.
I recommend/use boost::spirit, boost::thread, boost::lambda, phoenix, boost::lexical_cast, boost::shared_ptr (occasionally), boost::filesystem and boost::datetime. All of them are excellent libraries. There aren't a great deal of [good] portable c++ threading libraries around, you know.
I am using mingw (the version that comes with dev-c++) but calling bjam and including the root path gives me a couple of hundred errors. It nags alot about VC++ mumbo-jumbo - maybe because I'm also using the VC++ compiler?
-Lord Maz-

This topic is closed to new replies.

Advertisement