Boost logo

Boost :

From: williamkempf_at_[hidden]
Date: 2001-09-26 08:30:58


--- In boost_at_y..., "Peter Dimov" <pdimov_at_m...> wrote:
> On pthreads, boost::once_init is defined like this:
>
> namespace boost
> {
> typedef pthread_once_t once_flag;
> const once_flag once_init = PTHREAD_ONCE_INIT;
> }
>
> Is it guaranteed that
>
> boost::once_flag x = boost::once_init;
>
> is statically initialized?

I meant to ask this myself and just forgot. I changed to this from
the more normal #define late in the game. My thinking is that const
variables are really just symbolic so static initialization should
still work, but I didn't know where to begin looking in the standard
to know if this were the case. If it's not we'll have to go back to
the #define, which is no big deal, but I should verify this ASAP.

Bill Kempf


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