The C++ Boost Libraries (Part 1 – Introduction)
January 13, 2009 – 11:36 pmAlthough I like to think of myself of a jack-of-all-programming-trades, I must admit that I am mainly a C++ man. I have dabbled in the seductive dark side of Java and C#, but still prefer the mad poetry that C++ code can generate. A few years ago, C++ was showing signs of its advanced years but this has changed with the Boost libraries – a set of weird and wonderful additions to the C++ standard libraries that really bring C++ into the current century.
I have been using boost for over a year, and I cannot claim to have scratched its surface. The parts that have found their way into my projects have all been well engineered and easy to use – each library goes through a lengthly review process before being part of the Boost distribution. It obviously pays off – several boost libraries are to be standard features of C++0x.
The Boost libraries fall into 3 main categories:
- Standardized cross platform APIs for modern OS features such as threading, filesystems, async-IO, and interprocess communication. Every project tended to roll their own half-baked wrappers, so it is nice to have some well thought out standard APIs for these features.
- New containers and algorithms that fill the gaps in the STL, such as the graph library and the string_algo functions along with various specialized mathematical operations.
- General low level helper libraries that add what amount to new language features. The bind library is perhaps the most useful example, allowing flexible function binding with arguments that works transparently with class members. I don’t even want to know what voodoo it does under the covers, but I use it all the time.
Not all of Boost is ridiculously arcane and subtle. Take, for instance, the humble boost::logic::tribool class. From the documentation – “A tribool implements 3-state boolean logic” – which is useful for situations like the following:
if (godExists)
std::cout << "Good news - there is a God\n";
else if (!godExists)
std::cout << "Good news - there is no God\n";
else
std::cout << "There may or may not be a God\n";
See what I was saying about mad poetry.
Related posts:
- The C++ Boost Libraries Part 6 – boost::any In C++ if you have a variable that you say...
- Using Exceptions in C++ C++ is big – it has been said that any...
- UIButton.titleLabel is not as useful as it looks I have been doing some iPhone development lately. Nothing too...
Related posts brought to you by Yet Another Related Posts Plugin.
3 Responses to “The C++ Boost Libraries (Part 1 – Introduction)”
I guess one good thing about having some of the Boost libraries in the standard is that some folks will finally be able to leverage all the goodness in Boost without having a horde of corporate laywers wagging their fingers and tongues about licensing, EULAs, and other mumbo-jumbo that gets in the way of getting the job done.
By Vince on Jan 23, 2009
Do I detect a hint of bitterness?
Actually I am looking forward to some of the other stuff in C++0x more. “Type Concepts” and proper lambda support are going to rock. Still at least a year away before we are going to be able to use them though.
By Andrew on Jan 23, 2009
I cannot read this text … the font is horrible. I stooped after the first paragraph.
How can I dynamically change it ?
Do I have to disable css for this site ? Or maybe a quick greasemonkey script …
By My eyessssssssssss on Dec 6, 2009