void const_test( json::value const & v ) { json::value::const_array_iterator iter = v.begin_array(); json::value::const_array_iterator iter_end = v.end_array(); int count = 0; while(iter != iter_end) { BOOST_TEST(*iter == count++); #ifdef COMPILE_ERROR *iter = count; // should create a compile error #endif ++iter; } BOOST_TEST(count == 5); }