Y
Hacker News
new
|
ask
|
show
|
jobs
by
moocowtruck
1990 days ago
can i say T : SomeConstraint ?
1 comments
jcelerier
1990 days ago
in C++ ? sure
template<SomeConstraint T> void F(T p) { ... }
or just
void F(SomeConstraint auto p) { ... }
like this for instance:
https://gcc.godbolt.org/z/hPM38T
link
moocowtruck
1984 days ago
cool, can i even add two constraints? or is it limited to one. Oh i see you have include concepts, is that new to c++20 then?
link