//Refer to: http://m...content-available-to-author-only...y.com/2013/06/03/overriding-the-broken-universal-reference-t/
#include <iostream>
template<typename T>
void apply( T&& value ) {
std::cout << "apply" << std::endl;
}
struct my_type { };
void apply( my_type && value ) {
std::cout << "my_type" << std::endl;
}
int main() {
apply( my_type() );
my_type a;
apply( a );
apply( static_cast<my_type const>(a) );
apply( static_cast<my_type const &>(a) );
}
Ly9SZWZlciB0bzogaHR0cDovL20uLi5jb250ZW50LWF2YWlsYWJsZS10by1hdXRob3Itb25seS4uLnkuY29tLzIwMTMvMDYvMDMvb3ZlcnJpZGluZy10aGUtYnJva2VuLXVuaXZlcnNhbC1yZWZlcmVuY2UtdC8KI2luY2x1ZGUgPGlvc3RyZWFtPgoKdGVtcGxhdGU8dHlwZW5hbWUgVD4Kdm9pZCBhcHBseSggVCYmIHZhbHVlICkgewogICAgc3RkOjpjb3V0IDw8ICJhcHBseSIgPDwgc3RkOjplbmRsOwp9CgpzdHJ1Y3QgbXlfdHlwZSB7IH07CnZvaWQgYXBwbHkoIG15X3R5cGUgJiYgdmFsdWUgKSB7CglzdGQ6OmNvdXQgPDwgIm15X3R5cGUiIDw8IHN0ZDo6ZW5kbDsKfQoKaW50IG1haW4oKSB7CglhcHBseSggbXlfdHlwZSgpICk7CglteV90eXBlIGE7CglhcHBseSggYSApOwoJYXBwbHkoIHN0YXRpY19jYXN0PG15X3R5cGUgY29uc3Q+KGEpICk7CglhcHBseSggc3RhdGljX2Nhc3Q8bXlfdHlwZSBjb25zdCAmPihhKSApOwp9Cg==