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

Fail to load namespace Spring Security http://www.springframework.org/security/tags -

sql - MySQL query optimization using coalesce -

unity3d - Unity local avoidance in user created world -