-
-
Save picanumber/c73b14dcd644c185b938 to your computer and use it in GitHub Desktop.
This file contains 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 <class F, class T> | |
struct O_x | |
{ | |
T& mem; | |
constexpr O_x(T& data) : mem(data) {} | |
constexpr decltype(auto) give() | |
{ | |
return mem; | |
} | |
constexpr decltype(auto) clone() | |
{ | |
return mem; | |
} | |
}; | |
template <class F, class T> | |
struct O_x<F, T&&> | |
{ | |
T mem; | |
constexpr O_x(T&& data) : mem(std::move(data)) {} | |
constexpr decltype(auto) give() | |
{ | |
return (mem); | |
} | |
constexpr decltype(auto) clone() | |
{ | |
return mem; | |
} | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment