Boost logo

Boost :

Subject: Re: [boost] [utility]proposal for a small utility of namespace
From: Andrey Semashev (andrey.semashev_at_[hidden])
Date: 2013-02-25 08:17:49


On Mon, Feb 25, 2013 at 10:11 AM, law chrono <chronolaw_at_[hidden]> wrote:
> I like c++ and boost,but write namespace is a boring work for brace-matching.
>
> So I write a small util with boost.preprocessor, like below:
>
> Then the code can be more clear and easy-reading:
>
> BOOST_BEGIN_NAMESPACE((boost)(asio)(ip))
> //namespace boost{namespace asio{namespace ip{
>
> ... //to something
>
> BOOST_END_NAMESPACE((boost)(asio)(ip)) //}}}
>
> c++11 inline namespace also can work:
>
> inline BOOST_BEGIN_NAMESPACE((detail))
> ... //to something
> BOOST_END_NAMESPACE((detail))
>
> I wander to know whether this util could be a part of boost.

IMHO, this just unnecessarily obfuscates the code, with no apparent
benefit (the closing braces are even shorter quite a bit). Also, I
expect this slow down compilation a little.


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