
On Mon, Feb 25, 2013 at 10:11 AM, law chrono <chronolaw@gmail.com> 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.