PDA

View Full Version : Recoomended order of learning boost...



indigo0086
07-08-2008, 07:59 AM
I have the boost library and have gotten it built and everything but need some advice on the order I should learn it to get kind of a full understanding of it. I'm not sure if all the libraries are meant to be interconnected but I know there are some less essential libraries. Any recommendations?

Mario F.
07-08-2008, 08:50 AM
I think you just read and go. Boost is in fact a collection of libraries. Some small, some large. Many quiet easy, others quiet complicated. So, it's not one can learn how to use boost. It's more one can learn how to use its individual libraries. The fact all libraries included attempt to follow the same Boost guidelines and practices helps this process.

My initiation with boost started with the documentation as I decided to read at least the introduction on each library. As I did so, I immediately recognized uses for some libraries and skipped others entirely unknowing at the time of their usefulness. You should try that. Boost documentation is excellent.

Other than that, make sure you don't skip

- the smart pointer templates,
- the regex library,
- pointer containers,
- min-max library,
- boost::any
- boost:array
- the generalized binders library, the boost::binder and functional library,
- iterators library

These are, of the top of my head, some of the most useful and that I find myself using more often. But there's a whole bunch of other cool stuff in there.

indigo0086
07-08-2008, 09:00 AM
I'm learning from the documentation. Unfortunately it doesn't covver compile time errors XP

Mario F.
07-08-2008, 09:05 AM
Hehe.... shot them on the C++ board. Almost everyone in here uses boost, latecomer ;)

matsp
07-08-2008, 09:14 AM
I'm learning from the documentation. Unfortunately it doesn't covver compile time errors XP

The actual errors that come out of a compiler when "messing up" with templates is often quite different for compiler A than compiler B, so it would be quite hard for the documentation to cover even the simpler forms, never mind what happens if you have really complicated compile time problems. Unless you mean compile time errors by boost itself [e.g using #error in a header file - those should be documented by the provider of the code, preferably both in the header file and in the documentation].

--
Mats

indigo0086
07-08-2008, 09:26 AM
Hehe.... shot them on the C++ board. Almost everyone in here uses boost, latecomer ;)

Hey man, I'm doing this in between my Java software Eng project, personal openGL projects and all that jazz. Break me a give...

CornedBee
07-08-2008, 02:08 PM
The libraries aren't at all interconnected. There are a few library-building libraries that are used a lot in the others, but they're not necessary to understand the usage.

I'd add Boost.Variant to the essentials Mario listed. Superficially similar to any, it has actually a very different application domain.
Also, Boost.Optional.

If you want to understand the Boost code, then you need - aside from a very good understanding of metaprogramming in general - to understand the Boost.Preprocessor library (a "standard library" for preprocessor metaprogramming), Boost.MPL (a "standard library" for template metaprogramming), and most recently Boost.Proto (a framework for creating expression template libraries - Boost.Spirit v2, Boost.Xpressive, and the next version of the binders and lambdas are based on it).

indigo0086
07-09-2008, 06:46 AM
The idea of metaprogramming always escapes me. I see it all the time but don't fully understand the concept. Do you recommend the beyond the standard library book?

CornedBee
07-09-2008, 06:52 AM
For metaprogramming, I recommend "Modern C++ Design" and "C++ Templates".

The core idea is two-fold. One is the generation of code that would be tedious or error-prone to write by hand, but can be the result of a program. Because it's a program generating a program, it's a meta-program. C++ has the interesting property that, with macros and templates, there are actually two metaprogramming facilities in the language, with different mechanisms and capabilities.
The other is to take code the user writes and modify it to become something else - something more efficient, perhaps. One example would be the expression templates in the Blitz C++ matrix library. Basically, it takes the instruction of the user to "perform computation X on A and B" and turns it into "create an object that performs X on A and B as needed".

indigo0086
07-09-2008, 05:26 PM
all this searching on C++ metaprogramming has had me encounter some angry peoples.

indigo0086
07-14-2008, 09:28 AM
Also they don't tell you what libraries to include aside from boost. Like you need winsock32 to use the Asio lib but it doesn't tell you that in the docs.

Mario F.
07-14-2008, 10:21 AM
Hmm... winsock32 is needed because without it you can't put the OS talking with the network layer. You will have the same requirements on any other operating systems supported by Boost. It's more or less like trying to use wxWidgets on windows without the Win32 API.

indigo0086
07-14-2008, 04:04 PM
true, but I wouldn't have known that without google, I'm not familiar with win32 APIs.

CornedBee
07-15-2008, 02:46 AM
The ASIO documentation is not perfect. Other libraries, like MPI, Regex and IOStreams, do tell you what else they need.

indigo0086
07-22-2008, 10:28 AM
*sigh* never mind.