Skip to content
This repository was archived by the owner on Jan 15, 2021. It is now read-only.
This repository was archived by the owner on Jan 15, 2021. It is now read-only.

yotta docs should recommend inline namespaces #699

Open
@bremoran

Description

@bremoran

Yotta's namespacing recommendations could be improved. Instead of:

namespace mymodule { 
    namespace current {
        using namespace ::mymodule::v1;
    }
}

Yottadocs should advocate inline namespaces in C++11 repositories instead:

namespace mymodule { 
    namespace current {
        inline namespace ::mymodule::v1;
    }
}

This allows some improvements in how namespaces are handled:

e.g.:

namespace lib
{
    inline namespace v2
    {
        template< class T >
        struct traits
        { /*...*/ };
   }
}

Then, we can do this:

struct Mine
{};
namespace lib
{
template<>
struct traits< Mine >
{ /*...*/ };
}

With the using keyword, this template specialization is not possible.

cc @pan- @autopulated

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions