Boost logo

Boost :

From: David Abrahams (dave_at_[hidden])
Date: 2002-08-20 09:03:12


From: "Gennadiy Rozental" <gennadiy_at_[hidden]>

> > > > Ah. Well, I guess that's what's happening. I'm still surprised that
it
> > > > should be instantiating unused templates; I would think huge
amounts
> of
> > my
> > > > own code would be broken if that were the case.
> > >
> > > gcc fails to compile following code:
> > >
> > > // ****************** start ******************
> > > template<typename FPT, typename ToleranceSource>
> > > inline bool
> > > compare_and_continue_impl( FPT left, FPT right, ToleranceSource
> > > tolerance_src )
> > > {
> > > close_at_tolerance<FPT> pred( tolerance_src );
> > > }
> > > // ****************** end ******************
> > >
> > > Here an error:
> > > a.cpp: In function `bool compare_and_continue_impl(FPT, FPT,
> > > ToleranceSource)':
> > > a.cpp:6: parse error before `>' token
> > >
> > > Does it correct?
> >
> > "Is it correct?" Quite possibly. If that's the whole translation unit,
> then
> > yes, it's quite correct. There's no definition for close_at_tolerance.
>
> But compare_and_continue_impl is not called. and should not be
instantiated
> accordingly, isn't it?

I think the use of explicit specialization (<FPT>) makes that a
non-dependent name, though I'm not certain. Did you try to get Comeau
online to compile it?

-----------------------------------------------------------
           David Abrahams * Boost Consulting
dave_at_[hidden] * http://www.boost-consulting.com


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk