On Friday 07 June 2002 10:48 am, Angus Leeming wrote:
> Thoughts?
>
> A possible work around would be to rename class_fun here, so
>
> template <class C, class A> void_class_fun_t<C, A>
> void_class_fun(C & c, void(C::*f)(A))
>
> I understand that void_class_fun_t was only created because other compilers
> can't cope with a return from a void function...
>
> Angus
>
>
> cxx: Error: ../../devel/src/bufferlist.C, line 297: #308 more than one
> instance
>           of overloaded function "lyx::class_fun" matches the argument
> list: function template "lyx::class_fun(C &, R (C::*)(A))"
>             function template "lyx::class_fun(C &, void (C::*)(A))"
>             argument types are: (BufferList, void (BufferList::*)(Buffer
> *)) lyx::class_fun(*this, &BufferList::emergencyWrite)); -----------------^
> cxx: Info: 1 error detected in the compilation of
> "../../devel/src/bufferlist.C"


Another possible fix, perhaps cleaner, would be to scrap void_class_fun_t 
entirely and do as boost does in this situation:
        return static_cast<R>(result);
If R=void, then the compiler should still be happy.

Angus

Reply via email to