Boost logo

Boost :

From: Stephan Diederich (S.Diederich_at_[hidden])
Date: 2006-09-03 12:24:36


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{
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>));

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?

Best regards,

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