Boost logo

Boost :

From: Ion Gaztañaga (igaztanaga_at_[hidden])
Date: 2007-08-24 11:23:20


Peter Dimov wrote:
> the author of X may have accidentally omitted the initialization of cn_.
> Without a default constructor, this doesn't compile and one needs to
> explicitly choose between
>
> X(): cn_( &mx_ ) {}
>
> and
>
> X(): cn_( 0 ) {} // no checking

What about...

template<Mutex>
class condition
{
condition();
explicit condition(any_mutex_type);
explicit condition(mutex_type& m);
//...
};

X(): cn_( mx_ ) {}
X(): cn_( std::any_mutex ){}
X(): cn_(){}

Regards,

Ion


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