tags:

views:

388

answers:

5
+2  Q: 

boost lite?

I heard there is a light implementation of boost where its only smart pointers and a few other very basic stuff. I think i heard it doesnt use any OS functions either. I tried searching for it but found nothing. Does anyone know what it is called or an implementation of boost styled smart pointers that doesnt require OS calls?

A: 

use boost with boost bcp

Raz
+4  A: 

You can use the bcp utility to extract only the subset of the full tree you need to support a given library. I'm not aware of any freestanding stripped-down Boost implementation though.

Bklyn
+9  A: 

You can use bcp, but remember that using the Boost libraries only makes you pay for what you use - the smart pointers are all implemented in header-only fashion, meaning there's no OS calls, no compiled library to link to, etc. Thus, if you're not distributing source code, you can download the full boost set, and use only the bits you need, without causing your application any (unasked for) grief.

Harper Shelby
How does being implemented in header-only fashion mean there's no OS calls?
The entirety of the Boost smart pointer implementation resides in a header file - it's implemented without any binary dependencies. Yes, you *could* put an OS-specific call in a header, but that's a Bad Idea, and I don't think it would pass the Boost review process.
Harper Shelby
+1  A: 

The smart pointers are part of the tr1 extensions to the standard library. If your compiler vendor includes it that would probably be the way to go. I know of gcc and Visual Studio 2008 for 2 examples where they are supported.

zdan
It looks like this is now included with Visual Studio 2008 SP1 (both full and Express editions). Yay! It used to be a separately downloaded feature pack.
Bklyn
+2  A: 

"boost lite" is generally used to refer to a style of boost usage where you limit yourself to the "headers only" boost components. So this includes the massively templated smart pointer headers and boost::bind, but not things like regex or program_options which require you to link with a library to get most of the functionality.

If you're building and releasing .libs, the boost-lite style means you don't introduce a link dependency on the boost libs (less hassle for downstream users), and if you use the pimpl idiom extensively you can just use smart ptrs etc internally and lib users won't even see boost types in your headers. This can be a useful change-management technique for introducing boost by stealth in conservative environments.

ie it's just a particular way of using a normal boost install, not some separate package.

timday