Boost logo

Boost :

From: David Abrahams (david.abrahams_at_[hidden])
Date: 2001-12-05 09:41:32


Everything looks find to me except the following:

----- Original Message -----
From: "p_michel_andre" <michel.andre_at_[hidden]>
To: <boost_at_[hidden]>
Sent: Wednesday, December 05, 2001 8:45 AM
Subject: [boost] iterator_adaptor: strange compile error

> I get the following error when using a method in one project but not
> the other. I havent got a clue what can be the error.
> packages\boost\boost\iterator_adaptors.hpp(628): error C2057:
> expected constant expression
> Converter.cpp(83): see reference to template
> instantiation 'boost::iter_adaptor<CollectionIteratorState<iter,Orderb
------------------------^^^^^^^^^^^^

I'm sure it has nothing to do with the problem, but where did this symbol
come from? boost contains no such symbol (it's "iterator_adaptor").

> ookList>,CollectionIter
> atorPolicy<OrderbookList>,OrderbookList,OrderbookList&,OrderbookList
> *,random_access_iter_tag,int>' being compiled
>
> In the boost\iterator_adaptors.hpp(638) it states:
>
> // Iterators >= ForwardIterator must produce real references
> // as required by the C++ standard requirements in Table 74.
> BOOST_STATIC_CONSTANT(bool, forward_iter_with_real_reference =
> (!
> boost::is_convertible<iterator_category*,std::forward_iterator_tag*>::
> value
> || boost::is_same<reference,value_type&>::value
> || boost::is_same<reference,const value_type&>::value));
>
>
> And as far I can see at least one of the expressions is true namely
> boost::is_same<reference,value_type&>::value should yield
> boost::is_same<OrderbookList&,OrderbookList&>::value wich should be
> true.
>
> I have compared build settings for both projects and the appear to be
> the same. Btw I'm using MSVC 6 latest sp.

My best guess is that it's just a compiler bug. You might try inserting the
following, just to see what type reference actually turns out to be:

    template <class T> struct undefined;

and then, just before the assertion:

    undefined<reference> x;

The error message should give you some idea of what's going on (I hope).

-Dave


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