Created
January 3, 2015 08:43
-
-
Save SHyx0rmZ/37c60079a8268590cca1 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| template <typename T> | |
| struct __stripper { | |
| using type = T; | |
| }; | |
| template <typename T> | |
| struct ___stripper<std::reference_wrapper<T>> { | |
| using type = T&; | |
| }; | |
| template <typename T1, typename T2> | |
| constexpr auto make_pair(T1 &&x, T2 &&y) -> std::pair< | |
| typename __stripper<typename std::decay<T1>::type>::type, | |
| typename __stripper<typename std::decay<T2>::type>::type | |
| > { | |
| using __pair_type = std::pair< | |
| typename __stripper<typename std::decay<T1>::type>::type, | |
| typename __stripper<typename std::decay<T2>::type>::type | |
| >; | |
| return __pair_type( | |
| std::forward<T1>(x), | |
| std::forward<T2>(y) | |
| ); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment