Boost logo

Boost :

From: David Abrahams (dave_at_[hidden])
Date: 2006-09-05 09:33:49

"Stephan Diederich" <S.Diederich_at_[hidden]> writes:

> Hello,
> I'm having problems with the LvaluePropertyMapConcept.
> I expected that following code should compile:
> #include <boost/vector_property_map.hpp>
> int main(){
> using namespace boost;
> typedef vector_property_map<int> tSillyVecMap;
> function_requires<LvaluePropertyMapConcept<tSillyVecMap, size_t> >();
> }
> Instead it bails out with an assertion from inside the LvaluePropertyMapConcept:
> Error: no matching call to »assertion_failed(mpl_::failed************
> boost::is_same<const int&, int&>::************)«
> It comes from that piece of code:
> template <class PMap, class Key>
> struct LvaluePropertyMapConcept{
> [snip]
> void constraints() {
> typedef typename property_traits<PMap>::reference reference;
> typedef typename property_traits<PMap>::value_type value_type;
> BOOST_MPL_ASSERT((boost::is_same<const value_type&, reference>));
> [snip]
> Is that the intended behaviour?
> If not, where's the bug? Should property_traits<PMap>::reference be
> const, or should the Concept test against a const reference?

That doesn't look right to me. I did some work on the concept
checking stuff recently, so I looked to see if I mis-translated the
original code, but AFAICT that's just what was in there from the
beginning. Jeremy?

Dave Abrahams
Boost Consulting

Boost list run by bdawes at, gregod at, cpdaniel at, john at