Join GitHub today
GitHub is home to over 36 million developers working together to host and review code, manage projects, and build software together.Sign up
Classic: Fixed position_iterator forming reference to local #422
When underlying iterator returns by value the corresponding position_iterator was providing iterator_adaptor with a reference type what lead to returning a reference to a local variable in dereference operator.
Made a custom trait because it is a way more elegant than:
typedef typename boost::mpl::if_c< boost::is_reference<reference>::value, typename boost::add_reference< typename boost::add_const< typename boost::remove_reference<reference>::type >::type >::type, typename boost::add_const<reference>::type >::type const_reference_type;