This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: error: forming reference to void


Hi Arturs,

> The question is, why gcc tries to resolve "operator *()" at variable
> declaration time, but not at operator invocation time? Yeah, *(void*) is
> meaningless, but so is (int)->.

I may be mistaken, but I think the methods of the instantiated template are
created when the template is instantiated, not when those methods are used.

In the case you've run into, a template specialization would be the
appropriate way to handle this situation.

HTH,
--Eljay


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]