c++ - Is this implementation of std::decay a correct one -
is implementation of std::decay correct one?
template<class t> t decaytype(t); template<class t> struct decay { using type = decltype(decaytype(declval<t>())); };
i ask because came across uses template branching manipulate type while seems acting definition.
forming function call requires passing value, requires copy/move constructor. implementation not general enough.
it gist of std::decay
does, though.
Comments
Post a Comment