Comments
cloudhosting14 wrote: As you would already know that managed hosting itself is another form of Cloud hosting in which the system administrations of servers is looked upon by the CPs. Similar is the case with managed multi Cloud hosting. You can very well understand how a big burden it would be to manage multi cloud servers for organization; this is why a service known as managed multi Cloud is provided to these users. This service ensures them the seam less running of their system administrative operations while organizations focus more on t...
Cloud Expo on Google News

SYS-CON.TV
Cloud Expo & Virtualization 2009 East
PLATINUM SPONSORS:
IBM
Smarter Business Solutions Through Dynamic Infrastructure
IBM
Smarter Insights: How the CIO Becomes a Hero Again
Microsoft
Windows Azure
GOLD SPONSORS:
Appsense
Why VDI?
CA
Maximizing the Business Value of Virtualization in Enterprise and Cloud Computing Environments
ExactTarget
Messaging in the Cloud - Email, SMS and Voice
Freedom OSS
Stairway to the Cloud
Sun
Sun's Incubation Platform: Helping Startups Serve the Enterprise
POWER PANELS:
Cloud Computing & Enterprise IT: Cost & Operational Benefits
How and Why is a Flexible IT Infrastructure the Key To the Future?
Click For 2008 West
Event Webcasts
What Is Boost? Boost Your C++ Programming With The Boost Libraries
For C++ programmers all over the world, Boost and the Boost libraries have become indispensable

For C++ programmers all over the world, Boost and the Boost libraries have become indispensable. Weighing in at 60 C++ libraries, Boost is a large collection of peer-reviewed code covering a wide range of domains. But why should you care about that? Well, because Boost can quickly become indispensable for you too.

It all started in 1998 when Beman Dawes, a member of the C++ Standards Committee, founded Boost as a proving ground for new C++ libraries. C++ and the C++ Standard Library had just become standardized in ISO/IEC 14882-98, but that didn't mean that the work was done. So a community was formed and right from the start Boost managed to attract luminaries who shared the idea that Open Source C++ libraries were key to the future success of C++ and that they needed to be proven in the field before being proposed for inclusion in the standard. Today the success of Boost is apparent when you look at the contents of TR1 (the first technical report containing C++ library extensions). Almost all of the libraries come from Boost. Those libraries include support for regular expressions, a type traits library, random number generation, tuples, and smart pointers.

With 60 libraries to choose from, it's helpful to see some examples of Boost's contents. One of the most widespread and popular libraries is Boost.Smart_ptr, a collection of smart pointers that make resource handling in C++ much less error prone. Another of my favorites is Boost.Bind, which creates function objects, optionally with bound arguments. When using the STL, Bind is a lifesaver that lets you create function objects on-the-fly. Boost.Regex brings regular expressions to C++, and supports both Perl-like expressions and the regex flavors from awk, grep, egrep, and emacs. For variant data types, there are two libraries in Boost: Boost.Any for unbounded variants and Boost.Variant for creating variants supporting a bounded set of types. For handling date and time calculations, there's Boost.Date_time. There's a portable threading library available called Boost.Thread. A compile-time analogue to the STL is available through Boost.Mpl, a library that makes the world of compile-time programming available even to us mortals. For manipulating mathematical graphs, there's Boost.Graph, which includes graph components and algorithms such as Dijkstra's shortest path, A* search, and topological sort. For delayed functions, there's a library called Boost.Function. If you need flexible callbacks, i.e., signals and slots, there's Boost.Signal. Do you need some string-related algorithm that's not available in the C++ Standard Library? See if Boost.String_algo has got what you need. Are you tired of platform-specific hacks for working with files and directories? Try Boost.Filesystem.

As you can see, the Boost libraries cover a wide range of domains. Visit www.boost.org for a complete listing, and while you're there, why not download the libraries? They're expertly designed, thoroughly tested, well documented, and free of charge.

The Boost libraries are released under the Boost License - or a license that complies with the Boost license requirements - and they are free for both commercial and non-commercial use. The big differences when compared with the GNU General Public License (GPL) are that derivative works don't have to release their source code, and that the Boost license only affects the Boost libraries, whereas the GPL also affects the code that uses GPL'd libraries. The relaxed license exists both for philosophical and practical reasons; and because Boost libraries often aim for inclusion in the C++ standard, they have to be free.

Boost is popular both in commercial and non-commercial projects, and is being used more and more in Linux distributions. Currently Boost comes bundled with Fedora, Debian, and NetBSD. Of course, the libraries are also available for download from www.boost.org. You'll also find that many best practices books are starting to talk about the Boost libraries and recommend that you use them, for example Scott Meyers' Effective C++.

There are several books of interest for anyone wanting to learn more about Boost. The first book published about Boost was The Boost Graph Library User Guide and Reference Manual, which, true to its name, talks about the ins and outs of the Graph library. Then came C++ Template Metaprogramming: Concepts, Tools, and Techniques from Boost and Beyond about template metaprogramming with the fantastic Mpl library. Finally, there's the recently published Beyond the C++ Standard Library: An Introduction to Boost, written by yours truly. The book briefly outlines all the Boost libraries, and provides in-depth coverage of 12 important ones. I hope that we'll see many more books about Boost in the future.

It's worth noting that the online documentation for the Boost libraries is very good.

I know that you're eager to see some code now, and I've chosen a short example program from my Boost book that shows how to use Boost.Regex to change the British spelling of the word "colour" to the American "color". The problem, of course, is that you have to account not only for the word "color," but "colors," "colorize," and so on:

#include <iostream>
#include <string>
#include "boost/regex.hpp"

void main() {
boost::regex reg("(Colo)(u)(r)",
boost::regex::icase|boost::regex::perl);

std::string s="Colour, colours, color, colourize";
s=boost::regex_replace(s,reg,"$1$3");
std::cout << s;
}

First we create a regular expression of type boost::regex, which holds the regex. It's a case-insensitive expression. The regex simply captures the word "colour" in three marked sub-expressions, which we need in order to surgically remove the letter "u" (the second sub-expression). Then, we apply the algorithm regex_replace() on a std::string, and use the format string $1$3, which corresponds to the first and third sub-expressions of the regex; here, everything but the letter "u." Finally, the modified string, s, is printed to std::cout to demonstrate that all traces of the British spelling are gone. That's just a short example to display some of the power of Boost.Regex. If you want more, I think you know what you need to do.

Before concluding this article, I'd like to tell you a little more about what's new at Boost. There are several libraries waiting in the review queue, which means that they've passed the first hurdle, which is to create interest among the Boosters. Of course, for a library to be submitted to Boost, it has to be more than just interesting and useful; it must be a complete package of software adhering to the Boost guidelines, and it must come with documentation. For any library to become accepted by Boost, it must undergo peer review. Let's take a quick look at some libraries that have recently been accepted into Boost. Boost.Foreach is a very handy macro that makes it simple to loop over the elements of all kinds of collections; Boost.Typeof provides an approximation of the forthcoming (and long-awaited!) language support for auto and typeof, which are mechanisms for querying the type of an expression; Boost.Statechart is a powerful library for creating finite state machines; Boost.Xpressive is a regular expression template library - essentially a bridge between regular expressions (see Boost.Regex) and the parser generator framework (see Boost.Spirit). If you're interested in knowing more about these libraries and other potential additions to Boost - and perhaps propose your own for inclusion - you'll want to join the Boost mailing lists, which are also accessible through newsgroup interfaces.

Only the future will tell which new libraries will make it into Boost, but rest assured that lively discussions on new potential additions to Boost will always be common on the mailing lists.

I hope that this introduction to Boost has whetted your appetite for this interesting community and collection of useful C++ libraries. I also hope to see you at www.boost.org and on the Boost mailing lists.

I'll leave you with a quote from Bjarne Stroustrup in an interview by Bill Venners. The topic was C++ programming styles, and the question was how to elevate one's level of programming, or, wittily, "how to climb above C-level":

"To get out of writing low-level code, you needn't start writing a lot of classes. Instead, start using facilities provided in libraries."

References

________

About Björn Karlsson
Björn Karlsson works as a senior software engineer at ReadSoft, where he spends most of his time designing and programming in C++. He has written a number of articles about C++ and the Boost libraries for publications such as "C/C++ Users Journal," "Overload," and the online journal "The C++ Source." His first book, Beyond the C++ Standard Library: An Introduction to Boost, was published by Addison-Wesley this year.

In order to post a comment you need to be registered and logged in.

Register | Sign-in

Reader Feedback: Page 1 of 1

What Is Boost? Boost Your C++ Programming With The Boost Libraries. For C++ programmers all over the world, Boost and the Boost libraries have become indispensable. Weighing in at 60 C++ libraries, Boost is a large collection of peer-reviewed code covering a wide range of domains. But why should you care about that? Well, because Boost can quickly become indispensable for you too.

What Is Boost? Boost Your C++ Programming With The Boost Libraries. For C++ programmers all over the world, Boost and the Boost libraries have become indispensable. Weighing in at 60 C++ libraries, Boost is a large collection of peer-reviewed code covering a wide range of domains. But why should you care about that? Well, because Boost can quickly become indispensable for you too.

What Is Boost? Boost Your C++ Programming With The Boost Libraries. For C++ programmers all over the world, Boost and the Boost libraries have become indispensable. Weighing in at 60 C++ libraries, Boost is a large collection of peer-reviewed code covering a wide range of domains. But why should you care about that? Well, because Boost can quickly become indispensable for you too.


Your Feedback
SYS-CON Australia News Desk wrote: What Is Boost? Boost Your C++ Programming With The Boost Libraries. For C++ programmers all over the world, Boost and the Boost libraries have become indispensable. Weighing in at 60 C++ libraries, Boost is a large collection of peer-reviewed code covering a wide range of domains. But why should you care about that? Well, because Boost can quickly become indispensable for you too.
SYS-CON Canada News Desk wrote: What Is Boost? Boost Your C++ Programming With The Boost Libraries. For C++ programmers all over the world, Boost and the Boost libraries have become indispensable. Weighing in at 60 C++ libraries, Boost is a large collection of peer-reviewed code covering a wide range of domains. But why should you care about that? Well, because Boost can quickly become indispensable for you too.
LinuxWorld News Desk wrote: What Is Boost? Boost Your C++ Programming With The Boost Libraries. For C++ programmers all over the world, Boost and the Boost libraries have become indispensable. Weighing in at 60 C++ libraries, Boost is a large collection of peer-reviewed code covering a wide range of domains. But why should you care about that? Well, because Boost can quickly become indispensable for you too.
Latest Cloud Developer Stories
SYS-CON Events announced today that Wowrack will exhibit at SYS-CON's 12th International Cloud Expo, which will take place on June 10–13, 2013, at the Javits Center in New York City, New York. Wowrack’s core expertise lies in high-availability Private and Public Cloud IaaS Hosti...
Cloud computing must have been brushing up on its bedside manner. HIPAA requirements now stipulate everyone in the health-care industry must begin migrating patient records and other data to cloud computing. By 2015, all medical professionals with access to patient records must ...
As enterprises deploy private IaaS clouds into production they are reevaluating their future application delivery models. SUSE and WSO2 believe that private PaaS will leverage the automation and scalability of Private IaaS solutions, such as OpenStack-based SUSE Cloud, to deliver...
Join us for an exclusive briefing with Gartner where they will talk about how IT Executives are modernizing data centers and transforming operations to focus resources on business value. During the session they will discuss how innovative IT solutions are needed to help IT deli...
Organizations across the world are increasingly starting to see the benefits of moving more and more services to the cloud. The focus on the cost-saving potential of cloud is rapidly shifting to completely transforming the business with cloud. As organizations are investing enorm...
Subscribe to the World's Most Powerful Newsletters
Subscribe to Our Rss Feeds & Get Your SYS-CON News Live!
Click to Add our RSS Feeds to the Service of Your Choice:
Google Reader or Homepage Add to My Yahoo! Subscribe with Bloglines Subscribe in NewsGator Online
myFeedster Add to My AOL Subscribe in Rojo Add 'Hugg' to Newsburst from CNET News.com Kinja Digest View Additional SYS-CON Feeds
Publish Your Article! Please send it to editorial(at)sys-con.com!

Advertise on this site! Contact advertising(at)sys-con.com! 201 802-3021

SYS-CON Featured Whitepapers
ADS BY GOOGLE

Breaking Cloud Computing News
NComputing, the leader in accelerating the adoption of desktop virtualization, today announced the l...