1 // Copyright 2010, Niels Dekker. 2 // 3 // Distributed under the Boost Software License, Version 1.0. (See 4 // accompanying file LICENSE_1_0.txt or copy at 5 // http://www.boost.org/LICENSE_1_0.txt) 6 // 7 // Test program for boost::initialized<T>. Must fail to compile. 8 // 9 // Initial: 2 May 2010 10 11 #include <boost/utility/value_init.hpp> 12 13 namespace 14 { direct_initialize_from_int()15 void direct_initialize_from_int() 16 { 17 // Okay: initialized<T> supports direct-initialization from T. 18 boost::initialized<int> direct_initialized_int(1); 19 } 20 copy_initialize_from_int()21 void copy_initialize_from_int() 22 { 23 // The following line should not compile, because initialized<T> 24 // was not intended to supports copy-initialization from T. 25 boost::initialized<int> copy_initialized_int = 1; 26 } 27 } 28 main()29int main() 30 { 31 // This should fail to compile, so there is no need to call any function. 32 return 0; 33 } 34