From 088434f46ad7f7917df864f9bfbda4aa6ee6693a Mon Sep 17 00:00:00 2001 From: bolero-MURAKAMI Date: Sun, 21 Feb 2016 21:24:08 +0900 Subject: [PATCH] fic for GCC5.3.0 --- README.rst | 4 +- .../test/random/test/distribution_generic.hpp | 87 ------------------- libs/test/random/test/engine_generic.hpp | 73 ---------------- sprout/string/string.hpp | 4 +- 4 files changed, 4 insertions(+), 164 deletions(-) delete mode 100644 libs/test/random/test/distribution_generic.hpp delete mode 100644 libs/test/random/test/engine_generic.hpp diff --git a/README.rst b/README.rst index 8f2831bb..60852c29 100644 --- a/README.rst +++ b/README.rst @@ -35,8 +35,8 @@ Supported Compilers Linux: -* GCC, C++11/14 mode: 4.7.0~4.7.4, 4.8.0~4.8.5, 4.9.0~4.9.3, 5.1.0, 5.2.0 -* Clang, C++11/14 mode: 3.2, 3.3, 3.4~3.4.2, 3.5.0~3.5.1, 3.6.0~3.6.2, 3.7.0 +* GCC, C++11/14 mode: 4.7.0~4.7.4, 4.8.0~4.8.5, 4.9.0~4.9.3, 5.1.0, 5.2.0, 5.3.0 +* Clang, C++11/14 mode: 3.2, 3.3, 3.4~3.4.2, 3.5.0~3.5.1, 3.6.0~3.6.2, 3.7.0~3.7.1 ******************************************************************************* Author diff --git a/libs/test/random/test/distribution_generic.hpp b/libs/test/random/test/distribution_generic.hpp deleted file mode 100644 index aa58e485..00000000 --- a/libs/test/random/test/distribution_generic.hpp +++ /dev/null @@ -1,87 +0,0 @@ -#ifndef SPROUT_LIBS_RANDOM_TEST_DISTRIBUTION_GENERIC_HPP -#define SPROUT_LIBS_RANDOM_TEST_DISTRIBUTION_GENERIC_HPP - -#include -#include -#include -#include -#include - -namespace testspr { - template - void random_distribution_test_generic() { - using namespace sprout; - { - SPROUT_STATIC_CONSTEXPR auto parm = typename Distribution::param_type(); - - SPROUT_STATIC_CONSTEXPR auto dist1 = Distribution(parm); - SPROUT_STATIC_CONSTEXPR auto dist2 = Distribution(parm); - - // min - // max - TESTSPR_BOTH_ASSERT(dist1.min() <= dist1.max()); - - // param - TESTSPR_BOTH_ASSERT(parm == dist1.param()); - { - auto dist_temp = Distribution(); - dist_temp.param(parm); - TESTSPR_ASSERT(dist_temp == dist1); - } - - // operator== - // operator!= - TESTSPR_BOTH_ASSERT(dist1 == dist2); - TESTSPR_BOTH_ASSERT(!(dist1 != dist2)); - - { - std::string s; - - // operator<< - { - std::ostringstream os; - os << dist1; - // ??? WORKAROUND: for Clang -#if !defined(__clang__) - TESTSPR_ASSERT(!!os); -#endif - s = os.str(); - } - - auto dist_temp = Distribution(); - - // operator>> - { - std::istringstream is(s); - is >> dist_temp; - // ??? WORKAROUND: for Clang -#if !defined(__clang__) - TESTSPR_ASSERT(!!is); -#endif - } - - TESTSPR_ASSERT(dist_temp == dist1); - } - - // operator() - { - SPROUT_STATIC_CONSTEXPR auto eng = Engine(SPROUT_UNIQUE_SEED); - { - SPROUT_STATIC_CONSTEXPR auto rnd = dist1(eng); - - // result - TESTSPR_BOTH_ASSERT(dist1.min() <= rnd.result()); - TESTSPR_BOTH_ASSERT(rnd.result() <= dist1.max()); - - // engine - TESTSPR_BOTH_ASSERT(rnd.engine().min() <= rnd.engine().max()); - - // distribution - TESTSPR_BOTH_ASSERT(rnd.distribution().min() <= rnd.distribution().max()); - } - } - } - } -} // namespace testspr - -#endif // #ifndef SPROUT_LIBS_RANDOM_TEST_DISTRIBUTION_GENERIC_HPP diff --git a/libs/test/random/test/engine_generic.hpp b/libs/test/random/test/engine_generic.hpp deleted file mode 100644 index b7c2fc0b..00000000 --- a/libs/test/random/test/engine_generic.hpp +++ /dev/null @@ -1,73 +0,0 @@ -#ifndef SPROUT_LIBS_RANDOM_TEST_ENGINE_GENERIC_HPP -#define SPROUT_LIBS_RANDOM_TEST_ENGINE_GENERIC_HPP - -#include -#include -#include -#include - -namespace testspr { - template - void random_engine_test_generic() { - using namespace sprout; - { - SPROUT_STATIC_CONSTEXPR auto eng1 = Engine(SPROUT_UNIQUE_SEED); - SPROUT_STATIC_CONSTEXPR auto eng2 = Engine(SPROUT_UNIQUE_SEED); - - // min - // max - TESTSPR_BOTH_ASSERT(eng1.min() <= eng1.max()); - - // operator== - // operator!= - TESTSPR_BOTH_ASSERT(eng1 == eng1); - TESTSPR_BOTH_ASSERT(!(eng1 == eng2)); - TESTSPR_BOTH_ASSERT(eng1 != eng2); - TESTSPR_BOTH_ASSERT(!(eng1 != eng1)); - - { - std::string s; - - // operator<< - { - std::ostringstream os; - os << eng1; - // ??? WORKAROUND: for Clang -#if !defined(__clang__) - TESTSPR_ASSERT(!!os); -#endif - - s = os.str(); - } - - auto eng_temp = Engine(); - - // operator>> - { - std::istringstream is(s); - is >> eng_temp; - // ??? WORKAROUND: for Clang -#if !defined(__clang__) - TESTSPR_ASSERT(!!is); -#endif - } - - //TESTSPR_ASSERT(eng_temp == eng1); - } - - // operator() - { - SPROUT_STATIC_CONSTEXPR auto rnd = eng1(); - - // result - TESTSPR_BOTH_ASSERT(eng1.min() <= rnd.result()); - TESTSPR_BOTH_ASSERT(rnd.result() <= eng1.max()); - - // engine - TESTSPR_BOTH_ASSERT(rnd.engine().min() <= rnd.engine().max()); - } - } - } -} // namespace testspr - -#endif // #ifndef SPROUT_LIBS_RANDOM_TEST_ENGINE_GENERIC_HPP diff --git a/sprout/string/string.hpp b/sprout/string/string.hpp index a3bdfc39..247c43e6 100644 --- a/sprout/string/string.hpp +++ b/sprout/string/string.hpp @@ -691,7 +691,7 @@ namespace sprout { } SPROUT_CONSTEXPR size_type find_first_not_of(value_type const* s, size_type pos, size_type n) const { -#if SPROUT_GCC_IN_RANGE((5, 1, 0), (5, 3, 0)) +#if SPROUT_GCC_IN_RANGE((5, 1, 0), (5, 4, 0)) return sprout::string_detail::find_first_not_of_impl(begin(), size(), sprout::ptr_index(s), pos, n); #else return sprout::string_detail::find_first_not_of_impl(begin(), size(), s, pos, n); @@ -712,7 +712,7 @@ namespace sprout { } SPROUT_CONSTEXPR size_type find_last_not_of(value_type const* s, size_type pos, size_type n) const { -#if SPROUT_GCC_IN_RANGE((5, 1, 0), (5, 3, 0)) +#if SPROUT_GCC_IN_RANGE((5, 1, 0), (5, 4, 0)) return sprout::string_detail::find_last_not_of_impl(begin(), size(), sprout::ptr_index(s), pos, n); #else return sprout::string_detail::find_last_not_of_impl(begin(), size(), s, pos, n);