|
Boost : |
From: David Abrahams (dave_at_[hidden])
Date: 2007-06-24 15:14:21
on Sat Jun 23 2007, "Gennadiy Rozental" <gennadiy.rozental-AT-thomson.com> wrote:
> "David Abrahams" <dave_at_[hidden]> wrote in message
> news:87vede48j6.fsf_at_grogan.peloton...
>>
>> on Sat Jun 23 2007, "Gennadiy Rozental" <gennadiy.rozental-AT-thomson.com>
>> wrote:
>>
>>> After rereading this whole thread, I am still unclear: what is a proper
>>> way
>>> to implement there stateless keywords?
>>
>> look at boost/parameter/keyword.hpp
>
> Will do.
>
>>> Also I believe in many other places I am using type& within unnamed
>>> namespace. This seems to be valid usage, right?
>>
>> You've left out too much detail for me to make a determination.
>
> This is essentially boost/test/trivial_singleton.hpp:
>
> #define BOOST_TEST_SINGLETON_INST( inst ) \
> namespace { BOOST_JOIN( inst, _t)& inst = BOOST_JOIN( inst,
> _t)::instance(); }
>
> Here inst ## _t is type of singleton and inst is a reference to the
> instance
If your question is whether you are allowed to use references inside
unnamed namespaces, the answer is yes.
I note that you are still using dynamic initialization above. Using
brace-initialization is important to avoid order-of-initialization
problems.
-- Dave Abrahams Boost Consulting http://www.boost-consulting.com The Astoria Seminar ==> http://www.astoriaseminar.com
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk