1 // Copyright (C) 2003, Fernando Luis Cacciola Carballal.
2 // Copyright (C) 2015 Andrzej Krzemienski.
4 // Use, modification, and distribution is subject to the Boost Software
5 // License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
6 // http://www.boost.org/LICENSE_1_0.txt)
8 // See http://www.boost.org/lib/optional for documentation.
10 // You are welcome to contact the author at:
11 // fernando_cacciola@hotmail.com
14 #include "boost/optional/optional.hpp"
20 #ifndef BOOST_OPTIONAL_NO_INPLACE_FACTORY_SUPPORT
21 #include "boost/utility/in_place_factory.hpp"
22 #include "boost/utility/typed_in_place_factory.hpp"
25 #include "boost/core/lightweight_test.hpp"
26 #include "boost/none.hpp"
33 Guard(double num_
, std::string str_
) : num(num_
), str(str_
) {}
35 friend bool operator==(const Guard
& lhs
, const Guard
& rhs
) { return lhs
.num
== rhs
.num
&& lhs
.str
== rhs
.str
; }
36 friend bool operator!=(const Guard
& lhs
, const Guard
& rhs
) { return !(lhs
== rhs
); }
40 Guard
& operator=(const Guard
&);
46 #ifndef BOOST_OPTIONAL_NO_INPLACE_FACTORY_SUPPORT
47 typedef int BAD_TARGET_TYPE
;
48 boost::optional
<Guard
> og1 ( boost::in_place
<BAD_TARGET_TYPE
>(1.0, "one") );
50 NOTHING_TO_TEST_SO_JUST_FAIL