On Apr 23, 12:42 pm, Ian Collins <ian-n...@hotmail.com> wrote:
> u.int.32.t wrote:
>
> > For now, I am probably going to do the equivalent of:
>
> > template<typename T>
> > void accept(T & t); // T=const T when necessary
>
> > and in the cases where I call accept like:
>
> > accept(someRvalueFromFunction())
>
> > I'll change it to:
>
> > accept(static_cast<const T&>(someRvalueFromFunction());
>
> > How does that sound?
>
> Why can't you just overload accept for const?
Because accept is in really an polymorphic n-ary forwarding function.
I think it would be prohibitive to have overloads for each
permutation.
If it were just accept(T1), that would work, but its really
accept(T1,T2,T3,T4,...) etc, etc.
|