M
Michael Lehn
Assume I have some templated class
template <typename T>
struct Dummy {
// ...
};
And I want to overload a fucntion 'foo' such that it accepts a lvalue
or rvalue reference of it. I can do this using some 'IsDummy trait'
as follows:
template <typename A>
std::enable_if<IsDummy<A>::value, void>
foo(A &&dummy)
{
// ....
}
If I recall correctly some C++11 draft allowed that
template <typename A>
foo(Dummy<A> &&dummy)
{
// ....
}
would accept both, lvalue- and value- references.
Now my questions:
a) Is it correct that it was allowed in some draft?
b) Why was this feature/bug removed?
I think I read somewhere that it was due to a conflict with "concepts".
However, I can't find it anymore ...
template <typename T>
struct Dummy {
// ...
};
And I want to overload a fucntion 'foo' such that it accepts a lvalue
or rvalue reference of it. I can do this using some 'IsDummy trait'
as follows:
template <typename A>
std::enable_if<IsDummy<A>::value, void>
foo(A &&dummy)
{
// ....
}
If I recall correctly some C++11 draft allowed that
template <typename A>
foo(Dummy<A> &&dummy)
{
// ....
}
would accept both, lvalue- and value- references.
Now my questions:
a) Is it correct that it was allowed in some draft?
b) Why was this feature/bug removed?
I think I read somewhere that it was due to a conflict with "concepts".
However, I can't find it anymore ...