Constrained genericity: Difference between revisions

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
<lang c++>
template<typename T> //Detection helper struct
struct can_eat //Detects presence of non-const member function void eat()
{
Anonymous user