1 // Copyright (C) 2019 Andrzej Krzemienski.
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)
7 // See http://www.boost.org/lib/optional for documentation.
9 // You are welcome to contact the author at:
12 #include "boost/optional/optional.hpp"
18 #ifndef BOOST_OPTIONAL_DETAIL_NO_IS_CONSTRUCTIBLE_TRAIT
19 #ifndef BOOST_OPTIONAL_DETAIL_NO_SFINAE_FRIENDLY_CONSTRUCTORS
20 template <typename
, typename
>
27 template <typename T
, typename
= void>
32 // the following trait emulates properties std::iterator_traits
34 struct trait
<T
, BOOST_DEDUCED_TYPENAME void_t
<BOOST_DEDUCED_TYPENAME
T::value_type
,
35 BOOST_DEDUCED_TYPENAME
boost::enable_if
<boost::is_constructible
<T
, T
&> >::type
38 typedef BOOST_DEDUCED_TYPENAME
T::value_type value_type
;
41 // This class emulates the properties of std::filesystem::path
45 #if __cplusplus >= 201103
46 template <typename T
, typename
= BOOST_DEDUCED_TYPENAME trait
<T
>::value_type
>
50 Path(T
const&, BOOST_DEDUCED_TYPENAME trait
<T
>::value_type
* = 0);
60 #ifndef BOOST_OPTIONAL_DETAIL_NO_IS_CONSTRUCTIBLE_TRAIT
61 #ifndef BOOST_OPTIONAL_DETAIL_NO_SFINAE_FRIENDLY_CONSTRUCTORS
63 boost::optional
<Path
> optFs1
;
64 boost::optional
<Path
> optFs2
;
68 // the following still fails although it shouldn't
69 //BOOST_STATIC_ASSERT((std::is_copy_constructible<boost::optional<Path>>::value));