1 | /* |
---|---|
2 | * Copyright Andrey Semashev 2014. |
3 | * Distributed under the Boost Software License, Version 1.0. |
4 | * (See accompanying file LICENSE_1_0.txt or copy at |
5 | * http://www.boost.org/LICENSE_1_0.txt) |
6 | */ |
7 | /*! |
8 | * \file scoped_enum_compile_fail_conv_from_int.cpp |
9 | * \author Andrey Semashev |
10 | * \date 06.06.2014 |
11 | * |
12 | * \brief This test checks that scoped enum emulation prohibits implicit conversions from int |
13 | */ |
14 | |
15 | #include <boost/core/scoped_enum.hpp> |
16 | |
17 | BOOST_SCOPED_ENUM_DECLARE_BEGIN(color) |
18 | { |
19 | red, |
20 | green, |
21 | blue |
22 | } |
23 | BOOST_SCOPED_ENUM_DECLARE_END(color) |
24 | |
25 | int main(int, char*[]) |
26 | { |
27 | color col = 2; |
28 | |
29 | return boost::native_value(e: col); |
30 | } |
31 |