jeudi 30 juin 2016

Casting an alias template to the aliased type

Consider this code:

struct foo {/* stuff */};

template <typename T>
using bar = foo;

// Elsewhere
bar<int> A;
auto &B = static_cast<foo&>(A);

Is using B legal?

Aucun commentaire:

Enregistrer un commentaire