added tests to ensure correct constness behaviour

[SVN r18871]
This commit is contained in:
Jaakko Järvi
2003-06-26 15:19:01 +00:00
parent 28e34eb757
commit 359eaeecbf

View File

@ -20,6 +20,8 @@
#include "boost/tuple/tuple_comparison.hpp"
#include "boost/type_traits/is_const.hpp"
#include <string>
#include <utility>
@ -209,6 +211,15 @@ void element_access_test()
++get<0>(t);
BOOST_TEST(get<0>(t) == 6);
using boost::tuples::element;
BOOST_STATIC_ASSERT((boost::is_const<element<0, tuple<int, float> >::type>::value != true));
BOOST_STATIC_ASSERT((boost::is_const<element<0, const tuple<int, float> >::type>::value));
BOOST_STATIC_ASSERT((boost::is_const<element<1, tuple<int, float> >::type>::value != true));
BOOST_STATIC_ASSERT((boost::is_const<element<1, const tuple<int, float> >::type>::value));
dummy(i); dummy(i2); dummy(j); dummy(e); // avoid warns for unused variables
#else
double d = 2.7;