Skip to content

Instantly share code, notes, and snippets.

@srele96
Created November 30, 2023 22:41
Show Gist options
  • Save srele96/18da760cad7fd3bba881b64279be624e to your computer and use it in GitHub Desktop.
Save srele96/18da760cad7fd3bba881b64279be624e to your computer and use it in GitHub Desktop.
struct foo {
template <typename T>
foo(T p_object) {
p_object.process("hello");
}
};
struct bar {
void process(const std::string& p_value) { std::cout << p_value << "\n"; }
};
struct baz {};
foo f{bar{}};
foo b{baz{}}; // Fails at compile time.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment