Anonymous user
Constrained genericity: Difference between revisions
→{{header|C++}}: lang fixed
SqrtNegInf (talk | contribs) m (→{{header|Raku}}: .perl not needed) |
(→{{header|C++}}: lang fixed) |
||
Line 99:
{{works with|C++11}}
Uses static assertion to disallow instantiations on incorrect types
<lang cpp>template<typename T> //Detection helper struct▼
▲template<typename T> //Detection helper struct
struct can_eat //Detects presence of non-const member function void eat()
{
|