It has recently been brought to my attention that it is possible to use a namespace as a "qualifier" in the signature of a definition as opposed to using a block. EG:

//Begin declarations here
namespace ns
    extern int i;
    void foo();
    void bar();

//Begin definitions here
int ns::i = 5;
void ns::foo(){...}
void ns::bar(){...}
I did not know this was possible before, and I like this a lot, because:
  • It avoids a huge useless block/indent.
  • More closely resembles how you'd use static class encapsulation.

What I'm wondering though is: Is it possible to do something similar for an anonymous namespace? A lot of my .cpp files have internal helper functions/objects "forward declared" in an anonymous namespace, and then implemented later. I've tried:
    void helper();

//Begin implementations here
void helper(){...} //This is actually a brand new declaration
void ::helper(){...} //This doesn't compile
Is there any way to say: "This is the implementation for something declared in anonymous namespace", without actually opening a namespace block?