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

Popular posts from this blog

javascript - How to process users in one specific order using map o each function? -

java - Two interface have same method name with different return type -

javascript - Linking from page A to a specific iframe on page B -