
23 Sep
2011
23 Sep
'11
7:51 a.m.
Hi All This doesn't work. template<typename T> struct S { typename disable_if<is_const<T>, int>::type mutating_method(); }; I understand why not, although only after the compiler threw it out, but obviously (in hindsight), the method itself is not a template, so can't be selectively instantiated. The question is whether and how I can achieve the effect I'm after, ie., that the method is not present if the struct is instantiated with a const type? Thx, Rob.