Reputation: 2648
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?
Upvotes: 1
Views: 363
Reputation: 6440
Yes, it is. bar<T>
is exactly the same type as foo
for any T
.
Upvotes: 4