Const correctness fix for result_of::deref_data

This commit is contained in:
Joel de Guzman
2014-11-19 07:54:28 +08:00
parent c65000eac8
commit c952a5c053
2 changed files with 22 additions and 3 deletions

View File

@ -148,6 +148,15 @@ main()
typedef boost::fusion::result_of::deref_data<i_type>::type r_type;
BOOST_STATIC_ASSERT((boost::is_same<r_type, int&>::value));
}
{
// compile test only
// make sure result_of::deref_data is const correct
typedef map<pair<float, int> > const map_type;
typedef boost::fusion::result_of::begin<map_type>::type i_type;
typedef boost::fusion::result_of::deref_data<i_type>::type r_type;
BOOST_STATIC_ASSERT((boost::is_same<r_type, int const&>::value));
}
return boost::report_errors();
}