Created
March 29, 2022 15:35
-
-
Save KPB3rd/cb3d1ef6ec75d94d3951cd06fb9aaea6 to your computer and use it in GitHub Desktop.
Require a templated type for a member function
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 <class T> | |
| class(std::vector<thing> things) { | |
| static_assert(std::is_same_v<T, TheTypeIWant>, "This constructor requires TheTypeIWant!"); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment