Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- template <typename T>
- concept Foo = requires(T f, int x)
- {
- f.bar(x);
- };
- struct Bar { void bar(int x) {} };
- struct Cat { void bar(float x) {} };
- template <Foo T>
- void kek(T f)
- {
- f.bar(1);
- }
- int main()
- {
- kek(Bar{});
- kek(Cat{});
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement