mirror of
https://github.com/bolero-MURAKAMI/Sprout.git
synced 2024-12-23 21:25:49 +00:00
workaround for ICC 15
This commit is contained in:
parent
1cb62e6250
commit
755ebf4311
7 changed files with 41 additions and 7 deletions
|
@ -48,5 +48,6 @@
|
|||
#endif
|
||||
|
||||
#define SPROUT_WORKAROUND_NO_TEMPLATE_ARGUMENT_DEDUCTION_WITH_ALIASES
|
||||
#define SPROUT_WORKAROUND_NO_DEFAULT_TEMPLATE_PARAMETERS_SFINAE_WITH_ARRAY
|
||||
|
||||
#endif // #ifndef SPROUT_CONFIG_COMPILER_INTEL_HPP
|
||||
|
|
|
@ -40,11 +40,11 @@
|
|||
struct NAME<ELEM> { \
|
||||
public: \
|
||||
SPROUT_STATIC_CONSTEXPR sprout::basic_string<ELEM, LENGTH> value \
|
||||
SPROUT_STATIC_CONSTEXPR_DATA_MEMBER_INNER(sprout::to_string(STRING)) \
|
||||
SPROUT_STATIC_CONSTEXPR_DATA_MEMBER_INNER(STRING) \
|
||||
; \
|
||||
}; \
|
||||
SPROUT_CONSTEXPR_OR_CONST sprout::basic_string<ELEM, LENGTH> NAME<ELEM>::value \
|
||||
SPROUT_STATIC_CONSTEXPR_DATA_MEMBER_OUTER(sprout::to_string(STRING))
|
||||
SPROUT_STATIC_CONSTEXPR_DATA_MEMBER_OUTER(STRING)
|
||||
|
||||
//
|
||||
// SPROUT_LITERAL_CHAR_DEF
|
||||
|
|
|
@ -70,7 +70,8 @@ namespace sprout {
|
|||
SPROUT_CONSTEXPR boolean_flag() SPROUT_DEFAULTED_DEFAULT_CONSTRUCTOR_DECL
|
||||
boolean_flag(boolean_flag const&) = default;
|
||||
SPROUT_CONSTEXPR boolean_flag(bool flag)
|
||||
: flag_(flag)
|
||||
: sprout::integral_constant<sprout::io::flags::fmtflags, Flag>()
|
||||
, flag_(flag)
|
||||
{}
|
||||
SPROUT_CONSTEXPR boolean_flag operator()(bool flag) const {
|
||||
return boolean_flag(flag);
|
||||
|
|
|
@ -39,6 +39,7 @@
|
|||
#if SPROUT_USE_INDEX_ITERATOR_IMPLEMENTATION
|
||||
# include <sprout/iterator/index_iterator.hpp>
|
||||
#endif
|
||||
#include <sprout/workaround/enable_if_with_array.hpp>
|
||||
|
||||
namespace sprout {
|
||||
namespace detail {
|
||||
|
@ -317,15 +318,15 @@ namespace sprout {
|
|||
str, pos, NS_SSCRISK_CEL_OR_SPROUT::min(n, str.size() - pos)
|
||||
)
|
||||
{}
|
||||
template<std::size_t N2, typename Enable = typename std::enable_if<(N2 - 1 <= N)>::type>
|
||||
SPROUT_CONSTEXPR basic_string(T const(& arr)[N2])
|
||||
template<std::size_t N2 SPROUT_ENABLE_IF_WITH_ARRAY_IN_TEMPLATE_PARAMS((N2 - 1 <= N))>
|
||||
SPROUT_CONSTEXPR basic_string(T const(& arr)[N2] SPROUT_ENABLE_IF_WITH_ARRAY_IN_PARAMS((N2 - 1 <= N)))
|
||||
: impl_type(
|
||||
sprout::make_index_tuple<N2 - 1>::make(),
|
||||
arr, 0, sprout::char_traits_helper<typename sprout::basic_string<T, N2 - 1>::traits_type>::length(arr, N2 - 1)
|
||||
)
|
||||
{}
|
||||
template<std::size_t N2, typename Enable = typename std::enable_if<(N2 - 1 <= N)>::type>
|
||||
SPROUT_CONSTEXPR basic_string(T const(& arr)[N2], size_type n)
|
||||
template<std::size_t N2 SPROUT_ENABLE_IF_WITH_ARRAY_IN_TEMPLATE_PARAMS((N2 - 1 <= N))>
|
||||
SPROUT_CONSTEXPR basic_string(T const(& arr)[N2], size_type n SPROUT_ENABLE_IF_WITH_ARRAY_IN_PARAMS((N2 - 1 <= N)))
|
||||
: impl_type(
|
||||
sprout::make_index_tuple<N2 - 1>::make(),
|
||||
arr, 0, NS_SSCRISK_CEL_OR_SPROUT::min(n, sprout::char_traits_helper<typename sprout::basic_string<T, N2 - 1>::traits_type>::length(arr, N2 - 1))
|
||||
|
|
|
@ -23,6 +23,10 @@ namespace sprout {
|
|||
typedef typename std::integral_constant<T, V>::value_type value_type;
|
||||
typedef integral_constant type;
|
||||
public:
|
||||
#if defined(__INTEL_COMPILER) || defined(__ICL) || defined(__ICC) || defined(__ECC)
|
||||
SPROUT_CONSTEXPR integral_constant() SPROUT_NOEXCEPT {}
|
||||
integral_constant(integral_constant const&) = default;
|
||||
#endif
|
||||
SPROUT_CONSTEXPR
|
||||
operator value_type() const SPROUT_NOEXCEPT {
|
||||
return std::integral_constant<T, V>::value;
|
||||
|
|
|
@ -11,5 +11,6 @@
|
|||
#include <sprout/config.hpp>
|
||||
#include <sprout/workaround/recursive_function_template.hpp>
|
||||
#include <sprout/workaround/base_class_construct.hpp>
|
||||
#include <sprout/workaround/enable_if_with_array.hpp>
|
||||
|
||||
#endif // #ifndef SPROUT_WORKAROUND_HPP
|
||||
|
|
26
sprout/workaround/enable_if_with_array.hpp
Normal file
26
sprout/workaround/enable_if_with_array.hpp
Normal file
|
@ -0,0 +1,26 @@
|
|||
/*=============================================================================
|
||||
Copyright (c) 2011-2015 Bolero MURAKAMI
|
||||
https://github.com/bolero-MURAKAMI/Sprout
|
||||
|
||||
Distributed under 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)
|
||||
=============================================================================*/
|
||||
#ifndef SPROUT_WORKAROUND_ENABLE_IF_WITH_ARRAY_HPP
|
||||
#define SPROUT_WORKAROUND_ENABLE_IF_WITH_ARRAY_HPP
|
||||
|
||||
#include <type_traits>
|
||||
#include <sprout/config.hpp>
|
||||
|
||||
//
|
||||
// SPROUT_ENABLE_IF_WITH_ARRAY_IN_TEMPLATE_PARAMS
|
||||
// SPROUT_ENABLE_IF_WITH_ARRAY_IN_PARAMS
|
||||
//
|
||||
#ifdef SPROUT_WORKAROUND_NO_DEFAULT_TEMPLATE_PARAMETERS_SFINAE_WITH_ARRAY
|
||||
# define SPROUT_ENABLE_IF_WITH_ARRAY_IN_TEMPLATE_PARAMS(EXPR)
|
||||
# define SPROUT_ENABLE_IF_WITH_ARRAY_IN_PARAMS(EXPR) , typename std::enable_if<(EXPR)>::type* = 0
|
||||
#else
|
||||
# define SPROUT_ENABLE_IF_WITH_ARRAY_IN_TEMPLATE_PARAMS(EXPR) , typename = typename std::enable_if<(EXPR)>::type
|
||||
# define SPROUT_SFINAE_WITH_ARRAY_IN_PARAMS(EXPR)
|
||||
#endif
|
||||
|
||||
#endif // #ifndef SPROUT_WORKAROUND_ENABLE_IF_WITH_ARRAY_HPP
|
Loading…
Reference in a new issue