On Fri, Sep 23, 2011 at 11:48 PM, Igor R <boost.lists@gmail.com> wrote:
> I didn't test, but I think something like this should do the job:
>
>> template<typename T> struct S
>> {
>>     template <class T1 = T>
>>     typename disable_if<is_const<T1>, int>::type mutating_method();
>> };


Default template arguments are disallowed for function templates.

 

 
True, but they are allowed in C++0x/11 (and maybe the restriction applies only to free-standing functions, not methods, didn't have time to dig up more).
 
http://stackoverflow.com/questions/2447458/default-template-arguments-for-function-templates
 
Julien