mirror of
https://github.com/boostorg/optional.git
synced 2025-07-16 05:42:07 +02:00
fixed C++98-incompatible unit test
This commit is contained in:
@ -20,7 +20,7 @@ struct void_t
|
|||||||
{
|
{
|
||||||
typedef void type;
|
typedef void type;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
template <typename T, typename = void>
|
template <typename T, typename = void>
|
||||||
struct trait
|
struct trait
|
||||||
@ -29,7 +29,7 @@ struct trait
|
|||||||
|
|
||||||
// the following trait emulates properties std::iterator_traits
|
// the following trait emulates properties std::iterator_traits
|
||||||
template <typename T>
|
template <typename T>
|
||||||
struct trait<T, BOOST_DEDUCED_TYPENAME void_t<BOOST_DEDUCED_TYPENAME T::value_type,
|
struct trait<T, BOOST_DEDUCED_TYPENAME void_t<BOOST_DEDUCED_TYPENAME T::value_type,
|
||||||
BOOST_DEDUCED_TYPENAME boost::enable_if<boost::is_constructible<T, T&> >::type
|
BOOST_DEDUCED_TYPENAME boost::enable_if<boost::is_constructible<T, T&> >::type
|
||||||
>::type>
|
>::type>
|
||||||
{
|
{
|
||||||
@ -39,13 +39,20 @@ struct trait<T, BOOST_DEDUCED_TYPENAME void_t<BOOST_DEDUCED_TYPENAME T::value_ty
|
|||||||
// This class emulates the properties of std::filesystem::path
|
// This class emulates the properties of std::filesystem::path
|
||||||
struct Path
|
struct Path
|
||||||
{
|
{
|
||||||
|
|
||||||
|
#if __cplusplus >= 201103
|
||||||
template <typename T, typename = BOOST_DEDUCED_TYPENAME trait<T>::value_type>
|
template <typename T, typename = BOOST_DEDUCED_TYPENAME trait<T>::value_type>
|
||||||
Path(T const&);
|
Path(T const&);
|
||||||
|
#else
|
||||||
|
template <typename T>
|
||||||
|
Path(T const&, BOOST_DEDUCED_TYPENAME trait<T>::value_type* = 0);
|
||||||
|
#endif
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
int main()
|
int main()
|
||||||
{
|
{
|
||||||
#ifndef BOOST_OPTIONAL_DETAIL_NO_IS_CONSTRUCTIBLE_TRAIT
|
#ifndef BOOST_OPTIONAL_DETAIL_NO_IS_CONSTRUCTIBLE_TRAIT
|
||||||
#ifndef BOOST_OPTIONAL_DETAIL_NO_SFINAE_FRIENDLY_CONSTRUCTORS
|
#ifndef BOOST_OPTIONAL_DETAIL_NO_SFINAE_FRIENDLY_CONSTRUCTORS
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user