]>
Commit | Line | Data |
---|---|---|
7c673cae FG |
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 | // akrzemi1@gmail.com | |
11 | ||
12 | #include "boost/optional/optional.hpp" | |
13 | ||
14 | #ifdef __BORLANDC__ | |
15 | #pragma hdrstop | |
16 | #endif | |
17 | ||
18 | using boost::optional; | |
19 | ||
20 | #if (!defined BOOST_OPTIONAL_DETAIL_NO_IS_CONSTRUCTIBLE_TRAIT) | |
21 | ||
22 | struct X {}; | |
23 | struct Y {}; | |
24 | ||
25 | struct Resource | |
26 | { | |
27 | explicit Resource(const X&) {} | |
28 | }; | |
29 | ||
30 | BOOST_STATIC_ASSERT(( boost::is_constructible<Resource, const X&>::value)); | |
31 | BOOST_STATIC_ASSERT((!boost::is_constructible<Resource, const Y&>::value)); | |
32 | ||
33 | BOOST_STATIC_ASSERT(( boost::is_constructible<optional<Resource>, const X&>::value)); | |
34 | BOOST_STATIC_ASSERT((!boost::is_constructible<optional<Resource>, const Y&>::value)); | |
35 | ||
36 | #endif | |
37 | ||
38 | int main() { } |