struct foo {
void bar(int&&) && { }
};
template<class T>
using bar_t = void (std::decay_t<T>::*)(int&&) /* add && if T is an rvalue reference */;
int main()
{
using other_t = void (foo::*)(int&&) &&;
static_assert(std::is_same<bar_t<foo&&>, other_t>::value, "not the same");
return 0;
}
I want that
bar_t<T>yieldsvoid (foo::*)(int&&)ifT = foobar_t<T>yieldsvoid (foo::*)(int&&) constifT = foo constbar_t<T>yieldsvoid (foo::*)(int&&) &ifT = foo&bar_t<T>yieldsvoid (foo::*)(int&&) const&ifT = foo const&
and so on. How can I achieve that?