Boost logo

Boost :

From: Allen (yaozhen_at_[hidden])
Date: 2005-06-21 02:11:50


David Abrahams wrote:

> namespace whatever
> {
> class foo {};
>
> template <class T, int = 0>

Wonderful solution! However, I wonder what the default template argument
here (int = 0) is for?

> struct unique_instance
> {
> T& get()
> {
> static T x;
> return x;
> };
> };
>
> namespace
> {
> foo& bar = unique_instance<foo>::get();
> }
> }
>


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