> So I've recently come upon a situation where it would be useful to have
> nested namespaces.
This happens in a couple of places already: git grep -E 'impala::[a-z]' be
> 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.
Why can't you pass the methods in as parameter or a template parameter?
> 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.
I'm sorry, I don't understand. Here is what I wrote trying to
understand, but I think I am missing some big point.
struct Foo {
static void Bar();
};
#define CALL(f) f()
template<void F()>
void TemplateCall() { F(); }
void ParameterCall(void f()) { f(); }
int main() {
CALL(Foo::Bar);
TemplateCall<Foo::Bar>();
ParameterCall(Foo::Bar);
}
> I've seen conflicting documentation about nested namespace in Apache C++
> style guides, so wondering if we could have a discussion on that.
Each project has its own style guide. Here is Impala's:
https://cwiki.apache.org/confluence/pages/viewpage.action?pageId=65868536