Boost logo

Boost :

Subject: Re: [boost] [Boost.utility]
From: Andrew Chinkoff (achinkoff_at_[hidden])
Date: 2010-01-26 10:58:20


> One requires creating a new tailored object, the other adapts itself to
> any object un-intrusively.

> So it's pretty obvious global<int>.get() is better, and not just a
> matter of taste.

Let us discuss that:

1) Boost::global example:

typedef boost::global<int> global_Int;
global_int.get() = 5; // getting the global int

2) Boost::Singleton example:

typedef boost::Singleton<int> global_Int;
global_Int::Instance() = 5;

I really do not understand the appreciable advantage of the 1) over the 2)
and vice versa.:confused: The only thing I could say is that "get" is
shorter word than "Instance", isn't it?

-- 
View this message in context: http://old.nabble.com/-Boost.utility--tp27309940p27324932.html
Sent from the Boost - Dev mailing list archive at Nabble.com.

Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk