Boost logo

Boost :

From: David Abrahams (dave_at_[hidden])
Date: 2004-07-13 10:25:41


"DY, JERRY U (SBCSI)" <jd2419_at_[hidden]> writes:

> I'm trying to get spirit parser to compile in aC++, but aC++ errors on
> the following line. The problem apparently is that aC++ is not
> recognizing extract_int_ as a type, so a preceding typename keyword is
> required for it to compile. Hoping to get instruction on how to change
> this so that it won't break other compilers? Thanks!
>
> boost/spirit/core/primitives/impl/numerics.ipp:305
>
> return extract_int_<(MaxDigits >= 0)>::template
> apply<Radix, MinDigits, MaxDigits, Accumulate>::
> f(scan, n, count);
>
> fixed for aC++ is as follows, but may break other compilers??:
> return typename extract_int_<(MaxDigits >= 0)>::template
> apply<Radix, MinDigits, MaxDigits, Accumulate>::
> f(scan, n, count);

Nonconforming.

Try this:

    typedef typename extract_int_<(MaxDigits >= 0)>::template
             apply<Radix, MinDigits, MaxDigits, Accumulate> extractor;
    extractor::f(scan,n,count);

-- 
Dave Abrahams
Boost Consulting
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