workaround for libc++1101: no constexpr char_trais

This commit is contained in:
bolero-MURAKAMI 2013-08-06 13:25:32 +09:00
parent bbbf484a24
commit ce16e24637
16 changed files with 376 additions and 3 deletions

View file

@ -2,6 +2,7 @@
#define SPROUT_CONFIG_AUTO_CONFIG_HPP
#include <sprout/config/compiler.hpp>
#include <sprout/config/stdlib.hpp>
//
// SPROUT_CONFIG_DISABLE_CONSTEXPR

View file

@ -4,7 +4,7 @@
#define SPROUT_NO_CXX11_CONSTEXPR
#define SPROUT_NO_CXX11_DEFAULTED_FUNCTIONS
#define SPROUT_NO_CXX11_DELETED_FUNCTIONS
#if !defined(BOOST_CODEGEAR_0X_SUPPORT) || (__BORLANDC__ < 0x610)
#if !defined(SPROUT_CODEGEAR_0X_SUPPORT) || (__BORLANDC__ < 0x610)
# define SPROUT_NO_CXX11_EXPLICIT_CONVERSION_OPERATORS
#endif
#define SPROUT_NO_CXX11_NOEXCEPT

View file

@ -6,6 +6,7 @@
#endif // #ifndef SPROUT_CONFIG_DISABLE_AUTO_CONFIG
#include <sprout/config/compiler.hpp>
#include <sprout/config/stdlib.hpp>
#include <sprout/config/suffix.hpp>
#endif // #ifndef SPROUT_CONFIG_CONFIG_HPP

37
sprout/config/stdlib.hpp Normal file
View file

@ -0,0 +1,37 @@
#ifndef SPROUT_CONFIG_STDLIB_HPP
#define SPROUT_CONFIG_STDLIB_HPP
#ifdef __cplusplus
# include <cstddef>
#else
# include <stddef.h>
#endif
#if defined(__SGI_STL_PORT) || defined(_STLPORT_VERSION)
# include <sprout/config/stdlib/stlport.hpp>
#else
# include <utility>
# if defined(__LIBCOMO__)
# include <sprout/config/stdlib/libcomo.hpp>
# elif defined(__STD_RWCOMPILER_H__) || defined(_RWSTD_VER)
# include <sprout/config/stdlib/roguewave.hpp>
# elif defined(_LIBCPP_VERSION)
# include <sprout/config/stdlib/libcpp.hpp>
# elif defined(__GLIBCPP__) || defined(__GLIBCXX__)
# include <sprout/config/stdlib/libstdcpp3.hpp>
# elif defined(__STL_CONFIG_H)
# include <sprout/config/stdlib/sgi.hpp>
# elif defined(__MSL_CPP__)
# include <sprout/config/stdlib/msl.hpp>
# elif defined(__IBMCPP__)
# include <sprout/config/stdlib/vacpp.hpp>
# elif defined(MSIPL_COMPILE_H)
# include <sprout/config/stdlib/modena.hpp>
# elif (defined(_YVALS) && !defined(__IBMCPP__)) || defined(_CPPLIB_VER)
# include <sprout/config/stdlib/dinkumware.hpp>
# endif
#endif
#endif // #ifndef SPROUT_CONFIG_STDLIB_HPP

View file

@ -0,0 +1,39 @@
#ifndef SPROUT_CONFIG_STDLIB_DINKUMWARE_HPP
#define SPROUT_CONFIG_STDLIB_DINKUMWARE_HPP
#if !defined(_CPPLIB_VER) || _CPPLIB_VER < 520
# define SPROUT_NO_CXX11_HDR_ARRAY
# define SPROUT_NO_CXX11_HDR_CODECVT
# define SPROUT_NO_CXX11_HDR_FORWARD_LIST
# define SPROUT_NO_CXX11_HDR_INITIALIZER_LIST
# define SPROUT_NO_CXX11_HDR_RANDOM
# define SPROUT_NO_CXX11_HDR_REGEX
# define SPROUT_NO_CXX11_HDR_SYSTEM_ERROR
# define SPROUT_NO_CXX11_HDR_UNORDERED_MAP
# define SPROUT_NO_CXX11_HDR_UNORDERED_SET
# define SPROUT_NO_CXX11_HDR_TUPLE
# define SPROUT_NO_CXX11_HDR_TYPEINDEX
# define SPROUT_NO_CXX11_HDR_FUNCTIONAL
# define SPROUT_NO_CXX11_NUMERIC_LIMITS
# define SPROUT_NO_CXX11_SMART_PTR
#endif
#if (!defined(_HAS_TR1_IMPORTS) || (_HAS_TR1_IMPORTS+0 == 0)) && !defined(SPROUT_NO_CXX11_HDR_TUPLE)
# define SPROUT_NO_CXX11_HDR_TUPLE
#endif
#if !defined(_CPPLIB_VER) || _CPPLIB_VER < 540
# define SPROUT_NO_CXX11_HDR_TYPE_TRAITS
# define SPROUT_NO_CXX11_HDR_CHRONO
# define SPROUT_NO_CXX11_HDR_CONDITION_VARIABLE
# define SPROUT_NO_CXX11_HDR_FUTURE
# define SPROUT_NO_CXX11_HDR_MUTEX
# define SPROUT_NO_CXX11_HDR_RATIO
# define SPROUT_NO_CXX11_HDR_THREAD
# define SPROUT_NO_CXX11_ALLOCATOR
# define SPROUT_NO_CXX11_ATOMIC_SMART_PTR
#endif
#define SPROUT_NO_CXX11_HDR_INITIALIZER_LIST
#endif // #ifndef SPROUT_CONFIG_STDLIB_DINKUMWARE_HPP

View file

@ -0,0 +1,28 @@
#ifndef SPROUT_CONFIG_STDLIB_LIBCOMO_HPP
#define SPROUT_CONFIG_STDLIB_LIBCOMO_HPP
#define SPROUT_NO_CXX11_HDR_ARRAY
#define SPROUT_NO_CXX11_HDR_CHRONO
#define SPROUT_NO_CXX11_HDR_CODECVT
#define SPROUT_NO_CXX11_HDR_CONDITION_VARIABLE
#define SPROUT_NO_CXX11_HDR_FORWARD_LIST
#define SPROUT_NO_CXX11_HDR_FUTURE
#define SPROUT_NO_CXX11_HDR_INITIALIZER_LIST
#define SPROUT_NO_CXX11_HDR_MUTEX
#define SPROUT_NO_CXX11_HDR_RANDOM
#define SPROUT_NO_CXX11_HDR_RATIO
#define SPROUT_NO_CXX11_HDR_REGEX
#define SPROUT_NO_CXX11_HDR_SYSTEM_ERROR
#define SPROUT_NO_CXX11_HDR_THREAD
#define SPROUT_NO_CXX11_HDR_TUPLE
#define SPROUT_NO_CXX11_HDR_TYPE_TRAITS
#define SPROUT_NO_CXX11_HDR_TYPEINDEX
#define SPROUT_NO_CXX11_HDR_UNORDERED_MAP
#define SPROUT_NO_CXX11_HDR_UNORDERED_SET
#define SPROUT_NO_CXX11_NUMERIC_LIMITS
#define SPROUT_NO_CXX11_ALLOCATOR
#define SPROUT_NO_CXX11_ATOMIC_SMART_PTR
#define SPROUT_NO_CXX11_SMART_PTR
#define SPROUT_NO_CXX11_HDR_FUNCTIONAL
#endif // #ifndef SPROUT_CONFIG_STDLIB_LIBCOMO_HPP

View file

@ -0,0 +1,18 @@
#ifndef SPROUT_CONFIG_STDLIB_LIBCPP_HPP
#define SPROUT_CONFIG_STDLIB_LIBCPP_HPP
#ifdef _LIBCPP_HAS_NO_VARIADICS
# define SPROUT_NO_CXX11_HDR_TUPLE
#endif
#define SPROUT_NO_CXX11_HDR_CHRONO
#define SPROUT_NO_CXX11_HDR_FUTURE
#define SPROUT_NO_CXX11_HDR_TYPE_TRAITS
#define SPROUT_NO_CXX11_ATOMIC_SMART_PTR
#include <utility>
#if defined(_LIBCPP_VERSION) && (_LIBCPP_VERSION < 1101)
# define SPROUT_NO_CXX11_CHAR_TRAITS
#endif
#endif // #ifndef SPROUT_CONFIG_STDLIB_LIBCPP_HPP

View file

@ -0,0 +1,48 @@
#ifndef SPROUT_CONFIG_STDLIB_LIBSTDCPP3_HPP
#define SPROUT_CONFIG_STDLIB_LIBSTDCPP3_HPP
#if __GNUC__ < 4 || (__GNUC__ == 4 && __GNUC_MINOR__ < 3) || !defined(__GXX_EXPERIMENTAL_CXX0X__)
# define SPROUT_NO_CXX11_HDR_ARRAY
# define SPROUT_NO_CXX11_HDR_REGEX
# define SPROUT_NO_CXX11_HDR_TUPLE
# define SPROUT_NO_CXX11_HDR_UNORDERED_MAP
# define SPROUT_NO_CXX11_HDR_UNORDERED_SET
# define SPROUT_NO_CXX11_HDR_FUNCTIONAL
#endif
#if __GNUC__ < 4 || (__GNUC__ == 4 && __GNUC_MINOR__ < 4) || !defined(__GXX_EXPERIMENTAL_CXX0X__)
# define SPROUT_NO_CXX11_HDR_CONDITION_VARIABLE
# define SPROUT_NO_CXX11_HDR_FORWARD_LIST
# define SPROUT_NO_CXX11_HDR_INITIALIZER_LIST
# define SPROUT_NO_CXX11_HDR_MUTEX
# define SPROUT_NO_CXX11_HDR_RATIO
# define SPROUT_NO_CXX11_HDR_SYSTEM_ERROR
# define SPROUT_NO_CXX11_SMART_PTR
#endif
#if (!defined(_GLIBCXX_HAS_GTHREADS) || !defined(_GLIBCXX_USE_C99_STDINT_TR1)) && (!defined(SPROUT_NO_CXX11_HDR_CONDITION_VARIABLE) || !defined(SPROUT_NO_CXX11_HDR_MUTEX))
# define SPROUT_NO_CXX11_HDR_CONDITION_VARIABLE
# define SPROUT_NO_CXX11_HDR_MUTEX
#endif
#if __GNUC__ < 4 || (__GNUC__ == 4 && __GNUC_MINOR__ < 5) || !defined(__GXX_EXPERIMENTAL_CXX0X__)
# define SPROUT_NO_CXX11_NUMERIC_LIMITS
# define SPROUT_NO_CXX11_HDR_FUTURE
# define SPROUT_NO_CXX11_HDR_RANDOM
#endif
#if __GNUC__ < 4 || (__GNUC__ == 4 && __GNUC_MINOR__ < 6) || !defined(__GXX_EXPERIMENTAL_CXX0X__)
# define SPROUT_NO_CXX11_HDR_TYPEINDEX
#endif
#if __GNUC__ < 4 || (__GNUC__ == 4 && __GNUC_MINOR__ < 7) || !defined(__GXX_EXPERIMENTAL_CXX0X__)
# define SPROUT_NO_CXX11_HDR_CHRONO
# define SPROUT_NO_CXX11_ALLOCATOR
#endif
#define SPROUT_NO_CXX11_HDR_THREAD
#define SPROUT_NO_CXX11_HDR_TYPE_TRAITS
#define SPROUT_NO_CXX11_HDR_CODECVT
#define SPROUT_NO_CXX11_ATOMIC_SMART_PTR
#endif // #ifndef SPROUT_CONFIG_STDLIB_LIBSTDCPP3_HPP

View file

@ -0,0 +1,28 @@
#ifndef SPROUT_CONFIG_STDLIB_MODENA_HPP
#define SPROUT_CONFIG_STDLIB_MODENA_HPP
#define SPROUT_NO_CXX11_HDR_ARRAY
#define SPROUT_NO_CXX11_HDR_CHRONO
#define SPROUT_NO_CXX11_HDR_CODECVT
#define SPROUT_NO_CXX11_HDR_CONDITION_VARIABLE
#define SPROUT_NO_CXX11_HDR_FORWARD_LIST
#define SPROUT_NO_CXX11_HDR_FUTURE
#define SPROUT_NO_CXX11_HDR_INITIALIZER_LIST
#define SPROUT_NO_CXX11_HDR_MUTEX
#define SPROUT_NO_CXX11_HDR_RANDOM
#define SPROUT_NO_CXX11_HDR_RATIO
#define SPROUT_NO_CXX11_HDR_REGEX
#define SPROUT_NO_CXX11_HDR_SYSTEM_ERROR
#define SPROUT_NO_CXX11_HDR_THREAD
#define SPROUT_NO_CXX11_HDR_TUPLE
#define SPROUT_NO_CXX11_HDR_TYPE_TRAITS
#define SPROUT_NO_CXX11_HDR_TYPEINDEX
#define SPROUT_NO_CXX11_HDR_UNORDERED_MAP
#define SPROUT_NO_CXX11_HDR_UNORDERED_SET
#define SPROUT_NO_CXX11_NUMERIC_LIMITS
#define SPROUT_NO_CXX11_ALLOCATOR
#define SPROUT_NO_CXX11_ATOMIC_SMART_PTR
#define SPROUT_NO_CXX11_SMART_PTR
#define SPROUT_NO_CXX11_HDR_FUNCTIONAL
#endif // #ifndef SPROUT_CONFIG_STDLIB_MODENA_HPP

View file

@ -0,0 +1,28 @@
#ifndef SPROUT_CONFIG_STDLIB_MSL_HPP
#define SPROUT_CONFIG_STDLIB_MSL_HPP
#define SPROUT_NO_CXX11_HDR_ARRAY
#define SPROUT_NO_CXX11_HDR_CHRONO
#define SPROUT_NO_CXX11_HDR_CODECVT
#define SPROUT_NO_CXX11_HDR_CONDITION_VARIABLE
#define SPROUT_NO_CXX11_HDR_FORWARD_LIST
#define SPROUT_NO_CXX11_HDR_FUTURE
#define SPROUT_NO_CXX11_HDR_INITIALIZER_LIST
#define SPROUT_NO_CXX11_HDR_MUTEX
#define SPROUT_NO_CXX11_HDR_RANDOM
#define SPROUT_NO_CXX11_HDR_RATIO
#define SPROUT_NO_CXX11_HDR_REGEX
#define SPROUT_NO_CXX11_HDR_SYSTEM_ERROR
#define SPROUT_NO_CXX11_HDR_THREAD
#define SPROUT_NO_CXX11_HDR_TUPLE
#define SPROUT_NO_CXX11_HDR_TYPE_TRAITS
#define SPROUT_NO_CXX11_HDR_TYPEINDEX
#define SPROUT_NO_CXX11_HDR_UNORDERED_MAP
#define SPROUT_NO_CXX11_HDR_UNORDERED_SET
#define SPROUT_NO_CXX11_NUMERIC_LIMITS
#define SPROUT_NO_CXX11_ALLOCATOR
#define SPROUT_NO_CXX11_ATOMIC_SMART_PTR
#define SPROUT_NO_CXX11_SMART_PTR
#define SPROUT_NO_CXX11_HDR_FUNCTIONAL
#endif // #ifndef SPROUT_CONFIG_STDLIB_MSL_HPP

View file

@ -0,0 +1,31 @@
#ifndef SPROUT_CONFIG_STDLIB_ROGUEWAVE_HPP
#define SPROUT_CONFIG_STDLIB_ROGUEWAVE_HPP
#if _RWSTD_VER < 0x05000000
# define SPROUT_NO_CXX11_HDR_ARRAY
#endif
#define SPROUT_NO_CXX11_HDR_CHRONO
#define SPROUT_NO_CXX11_HDR_CODECVT
#define SPROUT_NO_CXX11_HDR_CONDITION_VARIABLE
#define SPROUT_NO_CXX11_HDR_FORWARD_LIST
#define SPROUT_NO_CXX11_HDR_FUTURE
#define SPROUT_NO_CXX11_HDR_INITIALIZER_LIST
#define SPROUT_NO_CXX11_HDR_MUTEX
#define SPROUT_NO_CXX11_HDR_RANDOM
#define SPROUT_NO_CXX11_HDR_RATIO
#define SPROUT_NO_CXX11_HDR_REGEX
#define SPROUT_NO_CXX11_HDR_SYSTEM_ERROR
#define SPROUT_NO_CXX11_HDR_THREAD
#define SPROUT_NO_CXX11_HDR_TUPLE
#define SPROUT_NO_CXX11_HDR_TYPE_TRAITS
#define SPROUT_NO_CXX11_HDR_TYPEINDEX
#define SPROUT_NO_CXX11_HDR_UNORDERED_MAP
#define SPROUT_NO_CXX11_HDR_UNORDERED_SET
#define SPROUT_NO_CXX11_NUMERIC_LIMITS
#define SPROUT_NO_CXX11_ALLOCATOR
#define SPROUT_NO_CXX11_ATOMIC_SMART_PTR
#define SPROUT_NO_CXX11_SMART_PTR
#define SPROUT_NO_CXX11_HDR_FUNCTIONAL
#endif // #ifndef SPROUT_CONFIG_STDLIB_ROGUEWAVE_HPP

View file

@ -0,0 +1,28 @@
#ifndef SPROUT_CONFIG_STDLIB_SGI_HPP
#define SPROUT_CONFIG_STDLIB_SGI_HPP
#define SPROUT_NO_CXX11_HDR_ARRAY
#define SPROUT_NO_CXX11_HDR_CHRONO
#define SPROUT_NO_CXX11_HDR_CODECVT
#define SPROUT_NO_CXX11_HDR_CONDITION_VARIABLE
#define SPROUT_NO_CXX11_HDR_FORWARD_LIST
#define SPROUT_NO_CXX11_HDR_FUTURE
#define SPROUT_NO_CXX11_HDR_INITIALIZER_LIST
#define SPROUT_NO_CXX11_HDR_MUTEX
#define SPROUT_NO_CXX11_HDR_RANDOM
#define SPROUT_NO_CXX11_HDR_RATIO
#define SPROUT_NO_CXX11_HDR_REGEX
#define SPROUT_NO_CXX11_HDR_SYSTEM_ERROR
#define SPROUT_NO_CXX11_HDR_THREAD
#define SPROUT_NO_CXX11_HDR_TUPLE
#define SPROUT_NO_CXX11_HDR_TYPE_TRAITS
#define SPROUT_NO_CXX11_HDR_TYPEINDEX
#define SPROUT_NO_CXX11_HDR_UNORDERED_MAP
#define SPROUT_NO_CXX11_HDR_UNORDERED_SET
#define SPROUT_NO_CXX11_NUMERIC_LIMITS
#define SPROUT_NO_CXX11_ALLOCATOR
#define SPROUT_NO_CXX11_ATOMIC_SMART_PTR
#define SPROUT_NO_CXX11_SMART_PTR
#define SPROUT_NO_CXX11_HDR_FUNCTIONAL
#endif // #ifndef SPROUT_CONFIG_STDLIB_SGI_HPP

View file

@ -0,0 +1,28 @@
#ifndef SPROUT_CONFIG_STDLIB_STLPORT_HPP
#define SPROUT_CONFIG_STDLIB_STLPORT_HPP
#define SPROUT_NO_CXX11_HDR_ARRAY
#define SPROUT_NO_CXX11_HDR_CHRONO
#define SPROUT_NO_CXX11_HDR_CODECVT
#define SPROUT_NO_CXX11_HDR_CONDITION_VARIABLE
#define SPROUT_NO_CXX11_HDR_FORWARD_LIST
#define SPROUT_NO_CXX11_HDR_FUTURE
#define SPROUT_NO_CXX11_HDR_INITIALIZER_LIST
#define SPROUT_NO_CXX11_HDR_MUTEX
#define SPROUT_NO_CXX11_HDR_RANDOM
#define SPROUT_NO_CXX11_HDR_RATIO
#define SPROUT_NO_CXX11_HDR_REGEX
#define SPROUT_NO_CXX11_HDR_SYSTEM_ERROR
#define SPROUT_NO_CXX11_HDR_THREAD
#define SPROUT_NO_CXX11_HDR_TUPLE
#define SPROUT_NO_CXX11_HDR_TYPE_TRAITS
#define SPROUT_NO_CXX11_HDR_TYPEINDEX
#define SPROUT_NO_CXX11_HDR_UNORDERED_MAP
#define SPROUT_NO_CXX11_HDR_UNORDERED_SET
#define SPROUT_NO_CXX11_NUMERIC_LIMITS
#define SPROUT_NO_CXX11_ALLOCATOR
#define SPROUT_NO_CXX11_ATOMIC_SMART_PTR
#define SPROUT_NO_CXX11_SMART_PTR
#define SPROUT_NO_CXX11_HDR_FUNCTIONAL
#endif // #ifndef SPROUT_CONFIG_STDLIB_STLPORT_HPP

View file

@ -0,0 +1,28 @@
#ifndef SPROUT_CONFIG_STDLIB_VACPP_HPP
#define SPROUT_CONFIG_STDLIB_VACPP_HPP
#define SPROUT_NO_CXX11_HDR_ARRAY
#define SPROUT_NO_CXX11_HDR_CHRONO
#define SPROUT_NO_CXX11_HDR_CODECVT
#define SPROUT_NO_CXX11_HDR_CONDITION_VARIABLE
#define SPROUT_NO_CXX11_HDR_FORWARD_LIST
#define SPROUT_NO_CXX11_HDR_FUTURE
#define SPROUT_NO_CXX11_HDR_INITIALIZER_LIST
#define SPROUT_NO_CXX11_HDR_MUTEX
#define SPROUT_NO_CXX11_HDR_RANDOM
#define SPROUT_NO_CXX11_HDR_RATIO
#define SPROUT_NO_CXX11_HDR_REGEX
#define SPROUT_NO_CXX11_HDR_SYSTEM_ERROR
#define SPROUT_NO_CXX11_HDR_THREAD
#define SPROUT_NO_CXX11_HDR_TUPLE
#define SPROUT_NO_CXX11_HDR_TYPE_TRAITS
#define SPROUT_NO_CXX11_HDR_TYPEINDEX
#define SPROUT_NO_CXX11_HDR_UNORDERED_MAP
#define SPROUT_NO_CXX11_HDR_UNORDERED_SET
#define SPROUT_NO_CXX11_NUMERIC_LIMITS
#define SPROUT_NO_CXX11_ALLOCATOR
#define SPROUT_NO_CXX11_ATOMIC_SMART_PTR
#define SPROUT_NO_CXX11_SMART_PTR
#define SPROUT_NO_CXX11_HDR_FUNCTIONAL
#endif // #ifndef SPROUT_CONFIG_STDLIB_VACPP_HPP

View file

@ -2,6 +2,7 @@
#define SPROUT_STRING_CHAR_TRAITS_HPP
#include <cstddef>
#include <cstdio>
#include <string>
#include <algorithm>
#include <sprout/config.hpp>
@ -66,12 +67,21 @@ namespace sprout {
static void assign(char_type& c1, char_type const& c2) SPROUT_NOEXCEPT {
impl_type::assign(c1, c2);
}
#ifdef SPROUT_NO_CXX11_CHAR_TRAITS
static SPROUT_CONSTEXPR bool eq(char_type c1, char_type c2) SPROUT_NOEXCEPT {
return c1 == c2;
}
static SPROUT_CONSTEXPR bool lt(char_type c1, char_type c2) SPROUT_NOEXCEPT {
return c1 < c2;
}
#else
static SPROUT_CONSTEXPR bool eq(char_type c1, char_type c2) SPROUT_NOEXCEPT {
return impl_type::eq(c1, c2);
}
static SPROUT_CONSTEXPR bool lt(char_type c1, char_type c2) SPROUT_NOEXCEPT {
return impl_type::lt(c1, c2);
}
#endif
static SPROUT_CONSTEXPR int compare(char_type const* s1, char_type const* s2, std::size_t n) {
return sprout::tristate_lexicographical_compare(
sprout::ptr_index(s1), sprout::ptr_index(s1, n), char_type(),
@ -102,6 +112,25 @@ namespace sprout {
static char_type* assign(char_type* s, std::size_t n, char_type a) {
return impl_type::assign(s, n, a);
}
#ifdef SPROUT_NO_CXX11_CHAR_TRAITS
static SPROUT_CONSTEXPR int_type not_eof(int_type c) SPROUT_NOEXCEPT {
return eq_int_type(c, eof()) ? int_type()
: c
;
}
static SPROUT_CONSTEXPR char_type to_char_type(int_type c) SPROUT_NOEXCEPT {
return static_cast<char_type>(c);
}
static SPROUT_CONSTEXPR int_type to_int_type(char_type c) SPROUT_NOEXCEPT {
return static_cast<int_type>(c);
}
static SPROUT_CONSTEXPR bool eq_int_type(int_type c1, int_type c2) SPROUT_NOEXCEPT {
return c1 == c2;
}
static SPROUT_CONSTEXPR int_type eof() SPROUT_NOEXCEPT {
return static_cast<int_type>(EOF);
}
#else
static SPROUT_CONSTEXPR int_type not_eof(int_type c) SPROUT_NOEXCEPT {
return impl_type::not_eof(c);
}
@ -117,6 +146,7 @@ namespace sprout {
static SPROUT_CONSTEXPR int_type eof() SPROUT_NOEXCEPT {
return impl_type::eof();
}
#endif
#if SPROUT_USE_INDEX_ITERATOR_IMPLEMENTATION
template<typename ConstIterator>
static SPROUT_CONSTEXPR int compare(char_type const* s1, ConstIterator s2, std::size_t n) {

View file

@ -34,7 +34,7 @@ namespace testspr {
//
#ifdef TESTSPR_HAS_CXXABI_H
namespace detail {
std::string gcc_demangle(char const* mangled) {
std::string cxa_demangle(char const* mangled) {
int status;
char* demangled = abi::__cxa_demangle(mangled, 0, 0, &status);
std::string result(demangled);
@ -44,7 +44,7 @@ namespace testspr {
} // namespace detail
template<typename T>
inline std::string typename_of() {
return testspr::detail::gcc_demangle(typeid(T).name());
return testspr::detail::cxa_demangle(typeid(T).name());
}
#else
template<typename T>