]>
Commit | Line | Data |
---|---|---|
7c673cae FG |
1 | // Copyright (C) 2015 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 | // akrzemi1@gmail.com | |
11 | ||
12 | #include "boost/core/ignore_unused.hpp" | |
13 | #include "boost/core/lightweight_test.hpp" | |
14 | #include "boost/optional/detail/optional_config.hpp" | |
15 | ||
16 | #ifndef BOOST_OPTIONAL_CONFIG_NO_PROPER_CONVERT_FROM_CONST_INT | |
17 | ||
18 | int main() | |
19 | { | |
20 | BOOST_ERROR("failed as requested"); | |
21 | return boost::report_errors(); | |
22 | } | |
23 | ||
24 | #else | |
25 | ||
26 | const int global_i = 0; | |
27 | ||
28 | struct Binder | |
29 | { | |
30 | Binder(const int& i) | |
31 | { | |
32 | BOOST_TEST(&i == &global_i); | |
33 | } | |
34 | }; | |
35 | ||
36 | int main() | |
37 | { | |
38 | Binder b = global_i; | |
39 | boost::ignore_unused(b); | |
40 | return boost::report_errors(); | |
41 | } | |
42 | ||
43 | #endif |