Boost logo

Boost :

Subject: Re: [boost] [lockfree] Faulty (?) static assert
From: Hartmut Kaiser (hartmut.kaiser_at_[hidden])
Date: 2012-09-02 11:45:41


> >>> Hmmm, I do not understand. If the queue is constructed with
> >>> fixed_size<false> (which is the default), this assertion will
> >>> _always_ fire as you're not required to specify a capacity in this
> case.
> >>
> >> that's the purpose of this assertion. if the data structure is not
> >> fixed- sized, you should use the explicit queue(int capacity)
> >> constructor in order to populate the free-list.
> >
> > In this case, I'd suggest converting the compile-time asserts into
> > run-time asserts as all non-templated constructors are always
> > instantiated regardless whether they will be called or not.
>
> hm, good point. will adapt the code

FWIW, the attached patch fixes this.

Regards Hartmut
---------------
http://boost-spirit.com
http://stellar.cct.lsu.edu




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