Created
November 26, 2022 12:58
-
-
Save alexgeek/b222fec6140438bd4541a39084dab7fd 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 CallbackType> | |
| struct callback_test final | |
| { | |
| callback_test(CallbackType&& callback) | |
| : callback(std::forward<CallbackType>(callback)) | |
| { | |
| } | |
| template<typename... U> | |
| auto operator()(U&&... u) -> decltype(std::declval<CallbackType>()(u...)) | |
| { | |
| return callback(u...); | |
| } | |
| private: | |
| void init(); | |
| CallbackType callback; | |
| }; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
final