Support identity for boost::result_of pre C++11

This commit is contained in:
Glen Fernandes
2022-01-12 01:46:04 -05:00
parent 0be868143d
commit 075c2e089a
4 changed files with 71 additions and 0 deletions
+20
View File
@@ -34,6 +34,26 @@ struct identity {
return value;
}
#endif
template<class>
struct result { };
template<class T>
struct result<identity(T&)> {
typedef T& type;
};
#if !defined(BOOST_NO_CXX11_RVALUE_REFERENCES)
template<class T>
struct result<identity(T)> {
typedef T&& type;
};
template<class T>
struct result<identity(T&&)> {
typedef T&& type;
};
#endif
};
} // boost