diff --git a/test/optional_test_ref.cpp b/test/optional_test_ref.cpp index 91149ba..2e7f3bf 100644 --- a/test/optional_test_ref.cpp +++ b/test/optional_test_ref.cpp @@ -337,12 +337,30 @@ void test_with_class_type() BOOST_CHECK ( X::count == 0 ) ; } +void test_binding() +{ + int i = 0 ; + optional ori1 = i ; + BOOST_CHECK( &(*ori1) == &i ) ; + + optional ori2(i) ; + BOOST_CHECK( &(*ori2) == &i ) ; + + int const ci = 0 ; + optional orci1 = ci ; + BOOST_CHECK( &(*orci1) == &ci ) ; + + optional orci2 = ci ; + BOOST_CHECK( &(*orci2) == &ci ) ; +} + int test_main( int, char* [] ) { try { test_with_class_type(); test_with_builtin_types(); + test_binding(); } catch ( ... ) {