
18 Jan
2009
18 Jan
'09
4:24 a.m.
Hi All, The example below illustrates my intent, but obviously it's not the right approach... so I'm hoping someone has a suggestion. template<typename X> struct enforce_constness{ typedef add_reference<const X> type; }; template<template<typename> class T = enforce_constness> struct A{ template<typename X> void operator()(typename T<X>::type x)const{ // Under default I'd like const X& }; } X x; A<> a; a(x); no match for call to (A<T>)(X&)