So I've recently come upon a situation where it would be useful to have
nested namespaces.  The reason is that there are a lot of static functions
in a class which I would like to benchmark.  Writing the same code to run
the benchmark test over and over is very tedious and is much more
efficiently accomplished with a macro.  However, since the functions are
embedded as static functions in a class, it isn't possible to pass the
names along as macro parameters, which would make this task much easier.
Instead I have to resort to a lot of duplicated parameters or multiple
levels of macros (since I can't easily convert :: into a legal member of a
function name).

If the functions were embedded instead in a nested namespace, a simple
'using namespace::subspace' declaration would bring all these to top level
in the benchmark and all would be well.

I've seen conflicting documentation about nested namespace in Apache C++
style guides, so wondering if we could have a discussion on that.

Thanks,

 - Zach

Reply via email to