namespace MyNamespace
{
    template <typename Type>
    class Container;

    namespace AccessPrivateImplementation
    {
        template <typename Type>
        Type getValue(Container<Type>* container);
    }

    template <typename Type>
    class Container
    {
        friend Type AccessPrivateImplementation::getValue<>(Container<Type>* volume);
    private:
        Type value;
    };

    namespace AccessPrivateImplementation
    {
        template <typename Type>
        Type getValue(Container<Type>* container)
        {
            return container->value;
        }
    }
}

int main(int argc, char* argv[])
{
    MyNamespace::Container<int> cont;
    MyNamespace::AccessPrivateImplementation::getValue(&cont);
    return 0;
}
