Skip to content

Instantly share code, notes, and snippets.

@KPB3rd
Created March 29, 2022 15:35
Show Gist options
  • Select an option

  • Save KPB3rd/cb3d1ef6ec75d94d3951cd06fb9aaea6 to your computer and use it in GitHub Desktop.

Select an option

Save KPB3rd/cb3d1ef6ec75d94d3951cd06fb9aaea6 to your computer and use it in GitHub Desktop.
Require a templated type for a member function
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