Boost logo

Boost :

From: Yuval Ronen (ronen_yuval_at_[hidden])
Date: 2005-12-10 05:33:34


Frank Laub wrote:
> class Boolean_base
> {
> protected:
> typedef boost::array<const char*, (size)+1> array_type;
> static const array_type& storage()
> {
> static const array_type names =
> {
> "False",
> "True",
> "2"
> };
> return names;
> }
> };

One more thing: using static data inside a function usually introduces
thread-safety issues. I'm not sure if boost::array suffers from this,
but I think it worth a check. If there is a problem, you might want to
switch to native C++ arrays, or get some help from Jason's singleton...


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