forked from boostorg/config
Added BOOST_NO_CXX17_ITERATOR_TRAITS macro.
The macro indicates that the standard library does not implement SFINAE-friendly std::iterator_traits (LWG issue 2408, [iterator.traits]/2).
This commit is contained in:
@ -1,6 +1,6 @@
|
||||
#
|
||||
# *** DO NOT EDIT THIS FILE BY HAND ***
|
||||
# This file was automatically generated on Mon May 29 10:27:35 2017
|
||||
# This file was automatically generated on Sun Jul 9 16:30:35 2017
|
||||
# by libs/config/tools/generate.cpp
|
||||
# Copyright John Maddock.
|
||||
# Use, modification and distribution are subject to the
|
||||
@ -111,6 +111,7 @@ obj cxx14_std_exchange : test_case.cpp : <define>TEST_BOOST_NO_CXX14_STD_EXCHANG
|
||||
obj cxx14_variable_templates : test_case.cpp : <define>TEST_BOOST_NO_CXX14_VARIABLE_TEMPLATES ;
|
||||
obj cxx17_fold_expressions : test_case.cpp : <define>TEST_BOOST_NO_CXX17_FOLD_EXPRESSIONS ;
|
||||
obj cxx17_inline_variables : test_case.cpp : <define>TEST_BOOST_NO_CXX17_INLINE_VARIABLES ;
|
||||
obj cxx17_iterator_traits : test_case.cpp : <define>TEST_BOOST_NO_CXX17_ITERATOR_TRAITS ;
|
||||
obj cxx17_std_apply : test_case.cpp : <define>TEST_BOOST_NO_CXX17_STD_APPLY ;
|
||||
obj cxx17_std_invoke : test_case.cpp : <define>TEST_BOOST_NO_CXX17_STD_INVOKE ;
|
||||
obj cxx17_structured_bindings : test_case.cpp : <define>TEST_BOOST_NO_CXX17_STRUCTURED_BINDINGS ;
|
||||
|
@ -1,4 +1,4 @@
|
||||
// This file was automatically generated on Mon May 29 10:27:35 2017
|
||||
// This file was automatically generated on Sun Jul 9 16:30:35 2017
|
||||
// by libs/config/tools/generate.cpp
|
||||
// Copyright John Maddock 2002-4.
|
||||
// Use, modification and distribution are subject to the
|
||||
@ -511,6 +511,11 @@
|
||||
# error "Defect macro BOOST_NO_CXX17_INLINE_VARIABLES is defined."
|
||||
# endif
|
||||
#endif
|
||||
#ifdef TEST_BOOST_NO_CXX17_ITERATOR_TRAITS
|
||||
# ifdef BOOST_NO_CXX17_ITERATOR_TRAITS
|
||||
# error "Defect macro BOOST_NO_CXX17_ITERATOR_TRAITS is defined."
|
||||
# endif
|
||||
#endif
|
||||
#ifdef TEST_BOOST_NO_CXX17_STD_APPLY
|
||||
# ifdef BOOST_NO_CXX17_STD_APPLY
|
||||
# error "Defect macro BOOST_NO_CXX17_STD_APPLY is defined."
|
||||
|
@ -945,6 +945,7 @@ that are not yet supported by a particular compiler or library.
|
||||
[[Macro ][Description ]]
|
||||
[[`BOOST_NO_CXX17_STD_APPLY`][The compiler does not support `std::apply()`.]]
|
||||
[[`BOOST_NO_CXX17_STD_INVOKE`][The compiler does not support `std::invoke()`.]]
|
||||
[[`BOOST_NO_CXX17_ITERATOR_TRAITS`][The compiler does not support SFINAE-friendly `std::iterator_traits`.]]
|
||||
]
|
||||
|
||||
[endsect]
|
||||
|
@ -175,6 +175,7 @@
|
||||
#endif
|
||||
#if !defined(_CPPLIB_VER) || (_CPPLIB_VER < 650)
|
||||
# define BOOST_NO_CXX17_STD_INVOKE
|
||||
# define BOOST_NO_CXX17_ITERATOR_TRAITS
|
||||
#endif
|
||||
|
||||
#if defined(BOOST_INTEL) && (BOOST_INTEL <= 1400)
|
||||
|
@ -79,6 +79,7 @@
|
||||
// C++17 features
|
||||
# define BOOST_NO_CXX17_STD_APPLY
|
||||
# define BOOST_NO_CXX17_STD_INVOKE
|
||||
# define BOOST_NO_CXX17_ITERATOR_TRAITS
|
||||
|
||||
//
|
||||
// Intrinsic type_traits support.
|
||||
|
@ -97,6 +97,8 @@
|
||||
# define BOOST_NO_AUTO_PTR
|
||||
#endif
|
||||
|
||||
#define BOOST_NO_CXX17_ITERATOR_TRAITS
|
||||
|
||||
#if (_LIBCPP_VERSION <= 1101) && !defined(BOOST_NO_CXX11_THREAD_LOCAL)
|
||||
// This is a bit of a sledgehammer, because really it's just libc++abi that has no
|
||||
// support for thread_local, leading to linker errors such as
|
||||
|
@ -247,6 +247,7 @@ extern "C" char *gets (char *__s);
|
||||
#if (BOOST_LIBSTDCXX_VERSION < 40600) || !defined(BOOST_LIBSTDCXX11)
|
||||
# define BOOST_NO_CXX11_HDR_TYPEINDEX
|
||||
# define BOOST_NO_CXX11_ADDRESSOF
|
||||
# define BOOST_NO_CXX17_ITERATOR_TRAITS
|
||||
#endif
|
||||
|
||||
// C++0x features in GCC 4.7.0 and later
|
||||
|
@ -68,6 +68,7 @@
|
||||
// C++17 features
|
||||
# define BOOST_NO_CXX17_STD_APPLY
|
||||
# define BOOST_NO_CXX17_STD_INVOKE
|
||||
# define BOOST_NO_CXX17_ITERATOR_TRAITS
|
||||
|
||||
#define BOOST_STDLIB "Modena C++ standard library"
|
||||
|
||||
|
@ -92,5 +92,6 @@
|
||||
// C++17 features
|
||||
# define BOOST_NO_CXX17_STD_APPLY
|
||||
# define BOOST_NO_CXX17_STD_INVOKE
|
||||
# define BOOST_NO_CXX17_ITERATOR_TRAITS
|
||||
|
||||
#define BOOST_STDLIB "Metrowerks Standard Library version " BOOST_STRINGIZE(__MSL_CPP__)
|
||||
|
@ -204,3 +204,4 @@
|
||||
// C++17 features
|
||||
# define BOOST_NO_CXX17_STD_APPLY
|
||||
# define BOOST_NO_CXX17_STD_INVOKE
|
||||
# define BOOST_NO_CXX17_ITERATOR_TRAITS
|
||||
|
@ -162,5 +162,6 @@
|
||||
// C++17 features
|
||||
# define BOOST_NO_CXX17_STD_APPLY
|
||||
# define BOOST_NO_CXX17_STD_INVOKE
|
||||
# define BOOST_NO_CXX17_ITERATOR_TRAITS
|
||||
|
||||
#define BOOST_STDLIB "SGI standard library"
|
||||
|
@ -252,5 +252,6 @@ namespace boost { using std::min; using std::max; }
|
||||
// C++17 features
|
||||
# define BOOST_NO_CXX17_STD_APPLY
|
||||
# define BOOST_NO_CXX17_STD_INVOKE
|
||||
# define BOOST_NO_CXX17_ITERATOR_TRAITS
|
||||
|
||||
#define BOOST_STDLIB "STLPort standard library version " BOOST_STRINGIZE(__SGI_STL_PORT)
|
||||
|
@ -68,5 +68,6 @@
|
||||
// C++17 features
|
||||
# define BOOST_NO_CXX17_STD_APPLY
|
||||
# define BOOST_NO_CXX17_STD_INVOKE
|
||||
# define BOOST_NO_CXX17_ITERATOR_TRAITS
|
||||
|
||||
#define BOOST_STDLIB "Visual Age default standard library"
|
||||
|
@ -57,3 +57,4 @@
|
||||
|
||||
#define BOOST_NO_CXX17_STD_INVOKE
|
||||
#define BOOST_NO_CXX17_STD_APPLY
|
||||
#define BOOST_NO_CXX17_ITERATOR_TRAITS
|
||||
|
@ -1,7 +1,7 @@
|
||||
#
|
||||
# Regression test Jamfile for boost configuration setup.
|
||||
# *** DO NOT EDIT THIS FILE BY HAND ***
|
||||
# This file was automatically generated on Mon May 29 10:27:35 2017
|
||||
# This file was automatically generated on Sun Jul 9 16:30:35 2017
|
||||
# by libs/config/tools/generate.cpp
|
||||
# Copyright John Maddock.
|
||||
# Use, modification and distribution are subject to the
|
||||
@ -322,6 +322,9 @@ test-suite "BOOST_NO_CXX17_FOLD_EXPRESSIONS" :
|
||||
test-suite "BOOST_NO_CXX17_INLINE_VARIABLES" :
|
||||
[ run ../no_cxx17_inline_variables_pass.cpp ]
|
||||
[ compile-fail ../no_cxx17_inline_variables_fail.cpp ] ;
|
||||
test-suite "BOOST_NO_CXX17_ITERATOR_TRAITS" :
|
||||
[ run ../no_cxx17_iterator_traits_pass.cpp ]
|
||||
[ compile-fail ../no_cxx17_iterator_traits_fail.cpp ] ;
|
||||
test-suite "BOOST_NO_CXX17_STD_APPLY" :
|
||||
[ run ../no_cxx17_std_apply_pass.cpp ]
|
||||
[ compile-fail ../no_cxx17_std_apply_fail.cpp ] ;
|
||||
|
49
test/boost_no_cxx17_iterator_traits.ipp
Normal file
49
test/boost_no_cxx17_iterator_traits.ipp
Normal file
@ -0,0 +1,49 @@
|
||||
// Copyright (c) Andrey Semashev 2017.
|
||||
// Use, modification and distribution are 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/libs/config for most recent version.
|
||||
|
||||
// MACRO: BOOST_NO_CXX17_ITERATOR_TRAITS
|
||||
// TITLE: C++17 std::iterator_traits
|
||||
// DESCRIPTION: The compiler does not support SFINAE-friendly std::iterator_traits defined in C++17.
|
||||
|
||||
#include <iterator>
|
||||
|
||||
namespace boost_no_cxx17_iterator_traits {
|
||||
|
||||
struct iterator :
|
||||
public std::iterator< std::random_access_iterator_tag, char >
|
||||
{
|
||||
};
|
||||
|
||||
struct non_iterator {};
|
||||
|
||||
template< typename T >
|
||||
struct void_type { typedef void type; };
|
||||
|
||||
template< typename Traits, typename Void = void >
|
||||
struct has_iterator_category
|
||||
{
|
||||
enum { value = false };
|
||||
};
|
||||
|
||||
template< typename Traits >
|
||||
struct has_iterator_category< Traits, typename void_type< typename Traits::iterator_category >::type >
|
||||
{
|
||||
enum { value = true };
|
||||
};
|
||||
|
||||
int test()
|
||||
{
|
||||
if (!has_iterator_category< std::iterator_traits< boost_no_cxx17_iterator_traits::iterator > >::value)
|
||||
return 1;
|
||||
|
||||
if (has_iterator_category< std::iterator_traits< boost_no_cxx17_iterator_traits::non_iterator > >::value)
|
||||
return 2;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
}
|
@ -1073,6 +1073,7 @@ void print_boost_macros()
|
||||
PRINT_MACRO(BOOST_NO_CXX14_VARIABLE_TEMPLATES);
|
||||
PRINT_MACRO(BOOST_NO_CXX17_FOLD_EXPRESSIONS);
|
||||
PRINT_MACRO(BOOST_NO_CXX17_INLINE_VARIABLES);
|
||||
PRINT_MACRO(BOOST_NO_CXX17_ITERATOR_TRAITS);
|
||||
PRINT_MACRO(BOOST_NO_CXX17_STD_APPLY);
|
||||
PRINT_MACRO(BOOST_NO_CXX17_STD_INVOKE);
|
||||
PRINT_MACRO(BOOST_NO_CXX17_STRUCTURED_BINDINGS);
|
||||
@ -1139,6 +1140,8 @@ void print_boost_macros()
|
||||
PRINT_MACRO(BOOST_NO_USING_TEMPLATE);
|
||||
PRINT_MACRO(BOOST_NO_VOID_RETURNS);
|
||||
|
||||
|
||||
|
||||
// END GENERATED BLOCK
|
||||
|
||||
PRINT_MACRO(BOOST_INTEL);
|
||||
|
@ -1,4 +1,4 @@
|
||||
// This file was automatically generated on Mon May 29 10:27:35 2017
|
||||
// This file was automatically generated on Sun Jul 9 16:30:35 2017
|
||||
// by libs/config/tools/generate.cpp
|
||||
// Copyright John Maddock 2002-4.
|
||||
// Use, modification and distribution are subject to the
|
||||
@ -342,6 +342,11 @@ namespace boost_no_cxx17_fold_expressions = empty_boost;
|
||||
#else
|
||||
namespace boost_no_cxx17_inline_variables = empty_boost;
|
||||
#endif
|
||||
#ifndef BOOST_NO_CXX17_ITERATOR_TRAITS
|
||||
#include "boost_no_cxx17_iterator_traits.ipp"
|
||||
#else
|
||||
namespace boost_no_cxx17_iterator_traits = empty_boost;
|
||||
#endif
|
||||
#ifndef BOOST_NO_CXX17_STD_APPLY
|
||||
#include "boost_no_cxx17_std_apply.ipp"
|
||||
#else
|
||||
@ -1476,6 +1481,11 @@ int main( int, char *[] )
|
||||
std::cerr << "Failed test for BOOST_NO_CXX17_INLINE_VARIABLES at: " << __FILE__ << ":" << __LINE__ << std::endl;
|
||||
++error_count;
|
||||
}
|
||||
if(0 != boost_no_cxx17_iterator_traits::test())
|
||||
{
|
||||
std::cerr << "Failed test for BOOST_NO_CXX17_ITERATOR_TRAITS at: " << __FILE__ << ":" << __LINE__ << std::endl;
|
||||
++error_count;
|
||||
}
|
||||
if(0 != boost_no_cxx17_std_apply::test())
|
||||
{
|
||||
std::cerr << "Failed test for BOOST_NO_CXX17_STD_APPLY at: " << __FILE__ << ":" << __LINE__ << std::endl;
|
||||
|
37
test/no_cxx17_iterator_traits_fail.cpp
Normal file
37
test/no_cxx17_iterator_traits_fail.cpp
Normal file
@ -0,0 +1,37 @@
|
||||
// This file was automatically generated on Sun Jul 9 15:26:23 2017
|
||||
// by libs/config/tools/generate.cpp
|
||||
// Copyright John Maddock 2002-4.
|
||||
// Use, modification and distribution are 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/libs/config for the most recent version.//
|
||||
// Revision $Id$
|
||||
//
|
||||
|
||||
|
||||
// Test file for macro BOOST_NO_CXX17_ITERATOR_TRAITS
|
||||
// This file should not compile, if it does then
|
||||
// BOOST_NO_CXX17_ITERATOR_TRAITS should not be defined.
|
||||
// See file boost_no_cxx17_iterator_traits.ipp for details
|
||||
|
||||
// Must not have BOOST_ASSERT_CONFIG set; it defeats
|
||||
// the objective of this file:
|
||||
#ifdef BOOST_ASSERT_CONFIG
|
||||
# undef BOOST_ASSERT_CONFIG
|
||||
#endif
|
||||
|
||||
#include <boost/config.hpp>
|
||||
#include "test.hpp"
|
||||
|
||||
#ifdef BOOST_NO_CXX17_ITERATOR_TRAITS
|
||||
#include "boost_no_cxx17_iterator_traits.ipp"
|
||||
#else
|
||||
#error "this file should not compile"
|
||||
#endif
|
||||
|
||||
int main( int, char *[] )
|
||||
{
|
||||
return boost_no_cxx17_iterator_traits::test();
|
||||
}
|
||||
|
37
test/no_cxx17_iterator_traits_pass.cpp
Normal file
37
test/no_cxx17_iterator_traits_pass.cpp
Normal file
@ -0,0 +1,37 @@
|
||||
// This file was automatically generated on Sun Jul 9 15:26:23 2017
|
||||
// by libs/config/tools/generate.cpp
|
||||
// Copyright John Maddock 2002-4.
|
||||
// Use, modification and distribution are 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/libs/config for the most recent version.//
|
||||
// Revision $Id$
|
||||
//
|
||||
|
||||
|
||||
// Test file for macro BOOST_NO_CXX17_ITERATOR_TRAITS
|
||||
// This file should compile, if it does not then
|
||||
// BOOST_NO_CXX17_ITERATOR_TRAITS should be defined.
|
||||
// See file boost_no_cxx17_iterator_traits.ipp for details
|
||||
|
||||
// Must not have BOOST_ASSERT_CONFIG set; it defeats
|
||||
// the objective of this file:
|
||||
#ifdef BOOST_ASSERT_CONFIG
|
||||
# undef BOOST_ASSERT_CONFIG
|
||||
#endif
|
||||
|
||||
#include <boost/config.hpp>
|
||||
#include "test.hpp"
|
||||
|
||||
#ifndef BOOST_NO_CXX17_ITERATOR_TRAITS
|
||||
#include "boost_no_cxx17_iterator_traits.ipp"
|
||||
#else
|
||||
namespace boost_no_cxx17_iterator_traits = empty_boost;
|
||||
#endif
|
||||
|
||||
int main( int, char *[] )
|
||||
{
|
||||
return boost_no_cxx17_iterator_traits::test();
|
||||
}
|
||||
|
Reference in New Issue
Block a user