mardi 22 septembre 2015

Typedef a member type of a template

I have a formulation like this:

template <typename A, typename B>
struct SomeLibraryClass
{
     using Foo = A;
     using Bar = B;
};

Now I want to use it but rename it since conceptually the usage is different.

template <typename A, typename B>
using quaz = SomeLibraryClass<A, B>;

However, if I want to get bar, it's still quaz::bar. But say I want quaz::bar to be quaz::foobar instead. Is this possible? Why or why not?

I cannot use inheritance. It silently breaks the code.

Aucun commentaire:

Enregistrer un commentaire