[Property Map] LvaluePropertyMapConcept problem

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? Best regards, Stephan

"Stephan Diederich" <S.Diederich@gmx.de> 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 www.boost-consulting.com
participants (2)
-
David Abrahams
-
Stephan Diederich