diff --git a/test/boost_has_part_alloc.ipp b/test/boost_has_part_alloc.ipp index fb4bf516..3e4c2cb8 100644 --- a/test/boost_has_part_alloc.ipp +++ b/test/boost_has_part_alloc.ipp @@ -28,6 +28,7 @@ template int test_allocator(const T& i) { typedef std::allocator alloc1_t; +#if !((__cplusplus > 201700) || (defined(_MSVC_LANG) && (_MSVC_LANG > 201700))) typedef typename alloc1_t::size_type size_type; typedef typename alloc1_t::difference_type difference_type BOOST_UNUSED_ATTRIBUTE; typedef typename alloc1_t::pointer pointer; @@ -35,9 +36,10 @@ int test_allocator(const T& i) typedef typename alloc1_t::reference reference; typedef typename alloc1_t::const_reference const_reference; typedef typename alloc1_t::value_type value_type BOOST_UNUSED_ATTRIBUTE; - +#endif alloc1_t a1; +#if !((__cplusplus > 201700) || (defined(_MSVC_LANG) && (_MSVC_LANG > 201700))) pointer p = a1.allocate(1); const_pointer cp = p; a1.construct(p,i); @@ -49,7 +51,7 @@ int test_allocator(const T& i) if(cp != a1.address(cr)) return -1; a1.destroy(p); a1.deallocate(p,1); - +#endif return 0; } diff --git a/test/boost_no_cxx11_hdr_type_traits.ipp b/test/boost_no_cxx11_hdr_type_traits.ipp index cf6cdd70..d4862a0c 100644 --- a/test/boost_no_cxx11_hdr_type_traits.ipp +++ b/test/boost_no_cxx11_hdr_type_traits.ipp @@ -45,7 +45,11 @@ int test() using std::is_trivially_copyable; using std::is_standard_layout; using std::is_pod; +#if !((__cplusplus > 201700) || (defined(_MSVC_LANG) && (_MSVC_LANG > 201700))) + // deprecated in C++ 17: using std::is_literal_type; + using std::result_of; +#endif using std::is_empty; using std::is_polymorphic; using std::is_abstract; @@ -99,7 +103,6 @@ int test() using std::conditional; using std::common_type; using std::underlying_type; - using std::result_of; return 0; } diff --git a/test/boost_no_cxx17_iterator_traits.ipp b/test/boost_no_cxx17_iterator_traits.ipp index ea75f232..5d0ee079 100644 --- a/test/boost_no_cxx17_iterator_traits.ipp +++ b/test/boost_no_cxx17_iterator_traits.ipp @@ -13,9 +13,13 @@ namespace boost_no_cxx17_iterator_traits { -struct iterator : - public std::iterator< std::random_access_iterator_tag, char > +struct iterator { + typedef std::random_access_iterator_tag iterator_category; + typedef char value_type; + typedef std::ptrdiff_t distance; + typedef char* pointer; + typedef char& reference; }; struct non_iterator {}; diff --git a/test/boost_no_std_allocator.ipp b/test/boost_no_std_allocator.ipp index d3badbd5..80e048e4 100644 --- a/test/boost_no_std_allocator.ipp +++ b/test/boost_no_std_allocator.ipp @@ -28,20 +28,33 @@ template int test_allocator(const T& i) { typedef std::allocator alloc1_t; +#if !((__cplusplus > 201700) || (defined(_MSVC_LANG) && (_MSVC_LANG > 201700))) + // stuff deprecated in C++17: typedef typename alloc1_t::size_type size_type; typedef typename alloc1_t::difference_type difference_type BOOST_UNUSED_ATTRIBUTE; typedef typename alloc1_t::pointer pointer; typedef typename alloc1_t::const_pointer const_pointer; typedef typename alloc1_t::reference reference; typedef typename alloc1_t::const_reference const_reference; + #endif typedef typename alloc1_t::value_type value_type BOOST_UNUSED_ATTRIBUTE; - typedef typename alloc1_t::BOOST_NESTED_TEMPLATE rebind binder_t; - typedef typename binder_t::other alloc2_t; - alloc1_t a1; alloc1_t a2(a1); +#if !((__cplusplus > 201700) || (defined(_MSVC_LANG) && (_MSVC_LANG > 201700))) + // stuff deprecated in C++17: + typedef typename alloc1_t::BOOST_NESTED_TEMPLATE rebind binder_t; + typedef typename binder_t::other alloc2_t; + alloc2_t a3(a1); + // this chokes early versions of the MSL library + // and isn't currently required by anything in boost + // so don't test for now... + // a3 = a2; + (void)a2; +#endif + +#if !((__cplusplus > 201700) || (defined(_MSVC_LANG) && (_MSVC_LANG > 201700))) pointer p = a1.allocate(1); const_pointer cp = p; a1.construct(p,i); @@ -52,15 +65,11 @@ int test_allocator(const T& i) if(p != a1.address(r)) return -1; if(cp != a1.address(cr)) return -1; a1.destroy(p); +#else + auto p = a1.allocate(1); +#endif a1.deallocate(p,1); - alloc2_t a3(a1); - // this chokes early versions of the MSL library - // and isn't currently required by anything in boost - // so don't test for now... - // a3 = a2; - - (void)a2; return 0; }