From: Gennadiy Rozental (gennadiy.rozental_at_[hidden])
Date: 2005-07-19 03:38:16


> Except that I plan to use a different policy mechanism with the new
> version, so that client code need only concern itself with relevant
> policies. Client code will be able to specialize specific policies for
> a given category, and then just choose a category for each singleton,
> like so:
>
> struct MySingletonCategory;
>
> // must provide specializations in singleton namespace
> namespace boost { namespace singleton {
>
> // the following specifies that multi threading will be used for
> singletons which use MySingletonCategory
> template < >
> struct threading_policy < MySingletonCategory >
> {
> typedef multi_threaded type;
> };

This should be called *trait* not a policy. Policy is type orthogonal. And
btw I don't think traits-based solution will work here. I most definitely
may want different threading policies for the same singleton type in
different circumstances.

Did you consider NTP?

Gennadiy