Aug 4, 2014

[C++11] RET trick

template<typename T1, typename T2, typename RET = pair<std::decay_t<T1>, std::decay_t<T2>>>
RET make_pair(T1&& x, T2&& y)
{
  return RET(std::forward<T1>(x), std::forward<T2>(y));
}

No comments:

Post a Comment

Note: Only a member of this blog may post a comment.