supernova: c++11 compile fixes
[supercollider.git] / external_libraries / boost_endian / libs / integer / test / scoped_enum_emulation_test.cpp
blob45d59e339dcada9ad84c88a4d857017dd27e8254
1 // scoped_enum_emulation_test.cpp ----------------------------------------------------//
3 // Copyright Beman Dawes, 2009
5 // Distributed under the Boost Software License, Version 1.0.
6 // See http://www.boost.org/LICENSE_1_0.txt
8 // See documentation at http://www.boost.org/libs/utility/scoped_enum_emulation.html
10 #include <boost/detail/scoped_enum_emulation.hpp>
11 #include <boost/assert.hpp>
13 BOOST_SCOPED_ENUM_START(traffic_light) { red=0, yellow, green }; BOOST_SCOPED_ENUM_END
15 BOOST_SCOPED_ENUM_START(algae) { green=0, red, cyan }; BOOST_SCOPED_ENUM_END
17 struct color
19 BOOST_SCOPED_ENUM_START(value_t) { red, green, blue }; BOOST_SCOPED_ENUM_END
20 BOOST_SCOPED_ENUM(value_t) value;
23 void foo( BOOST_SCOPED_ENUM(algae) arg )
25 BOOST_ASSERT( arg == algae::cyan );
28 int main()
30 BOOST_SCOPED_ENUM(traffic_light) signal( traffic_light::red );
31 BOOST_SCOPED_ENUM(algae) sample( algae::red );
33 BOOST_ASSERT( signal == traffic_light::red );
34 BOOST_ASSERT( sample == algae::red );
36 foo( algae::cyan );
38 color tracker;
39 tracker.value = color::value_t::blue;
41 return 0;