Boost logo

Boost Users :

Subject: Re: [Boost-users] [proto] extends example not compiling
From: Eric Niebler (eric_at_[hidden])
Date: 2009-12-16 05:01:06


Eric Niebler wrote:
> alfC wrote:
>> Is this example, contained in the boost.Proto manual supposed to
>> compile?
>>
>> #include<complex>
>> #include <boost/proto/core.hpp>
>> #include <boost/proto/context.hpp>
>> #include <boost/proto/debug.hpp>
>> #include<boost/proto/extends.hpp>
>>
>> template<class T, class Dummy = boost::proto::is_proto_expr>
>> struct my_complex
>> {
>> BOOST_PROTO_EXTENDS(
>> typename boost::proto::terminal<std::complex<T> >::type
>> , my_complex<T>
>> , boost::proto::default_domain
>> )
>> };
>>
>> int main()
>> {
>> my_complex<int> c0, c1;
>>
>> c0 + c1; // OK, operator+ found now!
>> }
>>
>> I get this error (with gcc 4.3 and gcc 4.4):
>> proto_complex.cpp:10: error: expected nested-name-specifier before
>> ‘typename’
>> proto_complex.cpp:10: error: two or more data types in declaration of
>> ‘proto_base_expr’
>> proto_complex.cpp:10: error: ‘proto_base_expr’ has not been declared
>> proto_complex.cpp:10: error: ‘proto_base_expr’ has not been declared
>
>
> I seem to recall seeing this error before with gcc. I think it's a
> compiler bug, but I haven't investigated.

I take it back. This is a bug in Proto. I'll fix it.

-- 
Eric Niebler
BoostPro Computing
http://www.boostpro.com

Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net