1 // Copyright (C) 2014 Andrzej Krzemienski. 2 // 3 // Use, modification, and distribution is subject to the Boost Software 4 // License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at 5 // http://www.boost.org/LICENSE_1_0.txt) 6 // 7 // See http://www.boost.org/lib/optional for documentation. 8 // 9 // You are welcome to contact the author at: 10 // [email protected] 11 12 #include "boost/optional/optional.hpp" 13 14 #ifdef BOOST_BORLANDC 15 #pragma hdrstop 16 #endif 17 18 #include "boost/core/lightweight_test.hpp" 19 20 struct Status 21 { 22 enum T 23 { 24 DISCONNECTED, 25 CONNECTING, 26 CONNECTED, 27 }; 28 29 T mValue; 30 }; 31 test_member_T()32void test_member_T() 33 { 34 boost::optional<Status> x = Status(); 35 x->mValue = Status::CONNECTED; 36 37 BOOST_TEST(x->mValue == Status::CONNECTED); 38 } 39 main()40int main() 41 { 42 test_member_T(); 43 return boost::report_errors(); 44 } 45