// Copyright (C) 2019 Andrzej Krzemienski. // // Use, modification, and distribution is subject to the Boost Software // License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at // http://www.boost.org/LICENSE_1_0.txt) // // See http://www.boost.org/lib/optional for documentation. // // You are welcome to contact the author at: // akrzemi1@gmail.com #include "boost/optional/optional.hpp" #ifdef BOOST_BORLANDC #pragma hdrstop #endif #ifndef BOOST_OPTIONAL_DETAIL_NO_IS_CONSTRUCTIBLE_TRAIT #ifndef BOOST_OPTIONAL_DETAIL_NO_SFINAE_FRIENDLY_CONSTRUCTORS template struct void_t { typedef void type; }; template struct trait { }; // the following trait emulates properties std::iterator_traits template struct trait >::type >::type> { typedef BOOST_DEDUCED_TYPENAME T::value_type value_type; }; // This class emulates the properties of std::filesystem::path struct Path { #if __cplusplus >= 201103 template ::value_type> Path(T const&); #else template Path(T const&, BOOST_DEDUCED_TYPENAME trait::value_type* = 0); #endif }; #endif #endif int main() { #ifndef BOOST_OPTIONAL_DETAIL_NO_IS_CONSTRUCTIBLE_TRAIT #ifndef BOOST_OPTIONAL_DETAIL_NO_SFINAE_FRIENDLY_CONSTRUCTORS boost::optional optFs1; boost::optional optFs2; optFs1 = optFs2; // the following still fails although it shouldn't //BOOST_STATIC_ASSERT((std::is_copy_constructible>::value)); #endif #endif }