Boost logo

Boost :

From: Vladimir Prus (ghost_at_[hidden])
Date: 2003-09-19 00:37:49


Robert Ramey wrote:
> Vladimir Prus wrote:
> >- if(file_version >= unsigned int(2))
> >+ if(file_version >= static_cast<unsigned int>(2))
>
> Hmm - I just changed it to:
> if(file_version >= 2)
>
> It compiles with VC and gcc 3.2. Does gcc 3.2 complain about that?

This is fine for 3.3.

> >- ar.register_type<bus_stop_corner>();
> >- ar.register_type<bus_stop_destination>();
> >+ ar.template register_type<bus_stop_corner>();
> >+ ar.template register_type<bus_stop_destination>();
>
> gosh - I've never seen that syntax before.
> I don't even know what it means.

This means: "consider register_type to be name of template"

> What was the 3.3 complaint with the original?

The complaint was:
demo.cpp: In member function `void bus_route::serialize(Archive&, unsigned
int)
   ':
demo.cpp:180: error: syntax error before `;' token

The minimal example is:

class C {
public:
        template<class Archive>
        void serialize(Archive& ar)
        {
             ar.register_type<int>();
        }
};

I was not able to test with online comeau, since it seems to fail on
everything, with no error messages. Further, I have failed to find the
relevant text in the standard. The syntax I've used is allowed by the
grammar, but I think there is some text about it as well.

- Volodya


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