diff --git a/sprout/algorithm/fit/clamp_range_copy.hpp b/sprout/algorithm/fit/clamp_range_copy.hpp index 1361b61c..e37db67b 100644 --- a/sprout/algorithm/fit/clamp_range_copy.hpp +++ b/sprout/algorithm/fit/clamp_range_copy.hpp @@ -9,7 +9,7 @@ #include #include #include -#include HDR_ALGORITHM_SSCRISK_CEL_OR_SPROUT +#include HDR_ALGORITHM_MIN_MAX_SSCRISK_CEL_OR_SPROUT #include namespace sprout { diff --git a/sprout/algorithm/fit/copy.hpp b/sprout/algorithm/fit/copy.hpp index 53713fb6..12d11d47 100644 --- a/sprout/algorithm/fit/copy.hpp +++ b/sprout/algorithm/fit/copy.hpp @@ -9,7 +9,7 @@ #include #include #include -#include HDR_ALGORITHM_SSCRISK_CEL_OR_SPROUT +#include HDR_ALGORITHM_MIN_MAX_SSCRISK_CEL_OR_SPROUT #include namespace sprout { diff --git a/sprout/algorithm/fit/copy_backward.hpp b/sprout/algorithm/fit/copy_backward.hpp index ca148a6d..5eaeb9e2 100644 --- a/sprout/algorithm/fit/copy_backward.hpp +++ b/sprout/algorithm/fit/copy_backward.hpp @@ -9,7 +9,7 @@ #include #include #include -#include HDR_ALGORITHM_SSCRISK_CEL_OR_SPROUT +#include HDR_ALGORITHM_MIN_MAX_SSCRISK_CEL_OR_SPROUT namespace sprout { namespace fit { diff --git a/sprout/algorithm/fit/copy_if.hpp b/sprout/algorithm/fit/copy_if.hpp index f6c2bc3c..e60d61dc 100644 --- a/sprout/algorithm/fit/copy_if.hpp +++ b/sprout/algorithm/fit/copy_if.hpp @@ -8,7 +8,7 @@ #include #include #include -#include HDR_ALGORITHM_SSCRISK_CEL_OR_SPROUT +#include HDR_ALGORITHM_MIN_MAX_SSCRISK_CEL_OR_SPROUT #include namespace sprout { diff --git a/sprout/algorithm/fit/copy_n.hpp b/sprout/algorithm/fit/copy_n.hpp index bf663e53..ecc62db9 100644 --- a/sprout/algorithm/fit/copy_n.hpp +++ b/sprout/algorithm/fit/copy_n.hpp @@ -8,7 +8,7 @@ #include #include #include -#include HDR_ALGORITHM_SSCRISK_CEL_OR_SPROUT +#include HDR_ALGORITHM_MIN_MAX_SSCRISK_CEL_OR_SPROUT namespace sprout { namespace fit { diff --git a/sprout/algorithm/fit/copy_until.hpp b/sprout/algorithm/fit/copy_until.hpp index 309fbd8f..9f54a7e9 100644 --- a/sprout/algorithm/fit/copy_until.hpp +++ b/sprout/algorithm/fit/copy_until.hpp @@ -10,7 +10,7 @@ #include #include #include -#include HDR_ALGORITHM_SSCRISK_CEL_OR_SPROUT +#include HDR_ALGORITHM_MIN_MAX_SSCRISK_CEL_OR_SPROUT #include namespace sprout { diff --git a/sprout/algorithm/fit/copy_while.hpp b/sprout/algorithm/fit/copy_while.hpp index 1e9a623f..f3feb3f8 100644 --- a/sprout/algorithm/fit/copy_while.hpp +++ b/sprout/algorithm/fit/copy_while.hpp @@ -10,7 +10,7 @@ #include #include #include -#include HDR_ALGORITHM_SSCRISK_CEL_OR_SPROUT +#include HDR_ALGORITHM_MIN_MAX_SSCRISK_CEL_OR_SPROUT #include namespace sprout { diff --git a/sprout/algorithm/fit/fill_n.hpp b/sprout/algorithm/fit/fill_n.hpp index 110c647e..0e4393c3 100644 --- a/sprout/algorithm/fit/fill_n.hpp +++ b/sprout/algorithm/fit/fill_n.hpp @@ -8,7 +8,7 @@ #include #include #include -#include HDR_ALGORITHM_SSCRISK_CEL_OR_SPROUT +#include HDR_ALGORITHM_MIN_MAX_SSCRISK_CEL_OR_SPROUT namespace sprout { namespace fit { diff --git a/sprout/algorithm/fit/generate_n.hpp b/sprout/algorithm/fit/generate_n.hpp index 77a4b341..6e0d4ab8 100644 --- a/sprout/algorithm/fit/generate_n.hpp +++ b/sprout/algorithm/fit/generate_n.hpp @@ -8,7 +8,7 @@ #include #include #include -#include HDR_ALGORITHM_SSCRISK_CEL_OR_SPROUT +#include HDR_ALGORITHM_MIN_MAX_SSCRISK_CEL_OR_SPROUT namespace sprout { namespace fit { diff --git a/sprout/algorithm/fit/merge.hpp b/sprout/algorithm/fit/merge.hpp index 3682ae44..4d89b7a2 100644 --- a/sprout/algorithm/fit/merge.hpp +++ b/sprout/algorithm/fit/merge.hpp @@ -9,7 +9,7 @@ #include #include #include -#include HDR_ALGORITHM_SSCRISK_CEL_OR_SPROUT +#include HDR_ALGORITHM_MIN_MAX_SSCRISK_CEL_OR_SPROUT #include namespace sprout { diff --git a/sprout/algorithm/fit/partition.hpp b/sprout/algorithm/fit/partition.hpp index 1c484e00..6d5b11d7 100644 --- a/sprout/algorithm/fit/partition.hpp +++ b/sprout/algorithm/fit/partition.hpp @@ -8,7 +8,7 @@ #include #include #include -#include HDR_ALGORITHM_SSCRISK_CEL_OR_SPROUT +#include HDR_ALGORITHM_MIN_MAX_SSCRISK_CEL_OR_SPROUT namespace sprout { namespace fit { diff --git a/sprout/algorithm/fit/partition_copy.hpp b/sprout/algorithm/fit/partition_copy.hpp index bccf9733..0ca303cb 100644 --- a/sprout/algorithm/fit/partition_copy.hpp +++ b/sprout/algorithm/fit/partition_copy.hpp @@ -10,7 +10,7 @@ #include #include #include -#include HDR_ALGORITHM_SSCRISK_CEL_OR_SPROUT +#include HDR_ALGORITHM_MIN_MAX_SSCRISK_CEL_OR_SPROUT #include HDR_FUNCTIONAL_SSCRISK_CEL_OR_SPROUT #include diff --git a/sprout/algorithm/fit/recurrence_n.hpp b/sprout/algorithm/fit/recurrence_n.hpp index bed8cfa2..0c88b5a5 100644 --- a/sprout/algorithm/fit/recurrence_n.hpp +++ b/sprout/algorithm/fit/recurrence_n.hpp @@ -8,7 +8,7 @@ #include #include #include -#include HDR_ALGORITHM_SSCRISK_CEL_OR_SPROUT +#include HDR_ALGORITHM_MIN_MAX_SSCRISK_CEL_OR_SPROUT namespace sprout { namespace fit { diff --git a/sprout/algorithm/fit/remove.hpp b/sprout/algorithm/fit/remove.hpp index 778d76a2..4e5895ad 100644 --- a/sprout/algorithm/fit/remove.hpp +++ b/sprout/algorithm/fit/remove.hpp @@ -8,7 +8,7 @@ #include #include #include -#include HDR_ALGORITHM_SSCRISK_CEL_OR_SPROUT +#include HDR_ALGORITHM_MIN_MAX_SSCRISK_CEL_OR_SPROUT namespace sprout { namespace fit { diff --git a/sprout/algorithm/fit/remove_copy.hpp b/sprout/algorithm/fit/remove_copy.hpp index 65756db8..579dd428 100644 --- a/sprout/algorithm/fit/remove_copy.hpp +++ b/sprout/algorithm/fit/remove_copy.hpp @@ -9,7 +9,7 @@ #include #include #include -#include HDR_ALGORITHM_SSCRISK_CEL_OR_SPROUT +#include HDR_ALGORITHM_MIN_MAX_SSCRISK_CEL_OR_SPROUT #include namespace sprout { diff --git a/sprout/algorithm/fit/remove_copy_if.hpp b/sprout/algorithm/fit/remove_copy_if.hpp index acb173d3..fbf1096e 100644 --- a/sprout/algorithm/fit/remove_copy_if.hpp +++ b/sprout/algorithm/fit/remove_copy_if.hpp @@ -9,7 +9,7 @@ #include #include #include -#include HDR_ALGORITHM_SSCRISK_CEL_OR_SPROUT +#include HDR_ALGORITHM_MIN_MAX_SSCRISK_CEL_OR_SPROUT #include namespace sprout { diff --git a/sprout/algorithm/fit/remove_if.hpp b/sprout/algorithm/fit/remove_if.hpp index c41f1188..333b8fbb 100644 --- a/sprout/algorithm/fit/remove_if.hpp +++ b/sprout/algorithm/fit/remove_if.hpp @@ -8,7 +8,7 @@ #include #include #include -#include HDR_ALGORITHM_SSCRISK_CEL_OR_SPROUT +#include HDR_ALGORITHM_MIN_MAX_SSCRISK_CEL_OR_SPROUT namespace sprout { namespace fit { diff --git a/sprout/algorithm/fit/replace_copy.hpp b/sprout/algorithm/fit/replace_copy.hpp index 61f1eebf..ca2e3cbe 100644 --- a/sprout/algorithm/fit/replace_copy.hpp +++ b/sprout/algorithm/fit/replace_copy.hpp @@ -9,7 +9,7 @@ #include #include #include -#include HDR_ALGORITHM_SSCRISK_CEL_OR_SPROUT +#include HDR_ALGORITHM_MIN_MAX_SSCRISK_CEL_OR_SPROUT #include namespace sprout { diff --git a/sprout/algorithm/fit/replace_copy_if.hpp b/sprout/algorithm/fit/replace_copy_if.hpp index 3d09b77f..88e333d2 100644 --- a/sprout/algorithm/fit/replace_copy_if.hpp +++ b/sprout/algorithm/fit/replace_copy_if.hpp @@ -9,7 +9,7 @@ #include #include #include -#include HDR_ALGORITHM_SSCRISK_CEL_OR_SPROUT +#include HDR_ALGORITHM_MIN_MAX_SSCRISK_CEL_OR_SPROUT #include namespace sprout { diff --git a/sprout/algorithm/fit/reverse_copy.hpp b/sprout/algorithm/fit/reverse_copy.hpp index 7e522d41..337afe93 100644 --- a/sprout/algorithm/fit/reverse_copy.hpp +++ b/sprout/algorithm/fit/reverse_copy.hpp @@ -9,7 +9,7 @@ #include #include #include -#include HDR_ALGORITHM_SSCRISK_CEL_OR_SPROUT +#include HDR_ALGORITHM_MIN_MAX_SSCRISK_CEL_OR_SPROUT namespace sprout { namespace fit { diff --git a/sprout/algorithm/fit/rotate_copy.hpp b/sprout/algorithm/fit/rotate_copy.hpp index d6840204..2614b7c8 100644 --- a/sprout/algorithm/fit/rotate_copy.hpp +++ b/sprout/algorithm/fit/rotate_copy.hpp @@ -9,7 +9,7 @@ #include #include #include -#include HDR_ALGORITHM_SSCRISK_CEL_OR_SPROUT +#include HDR_ALGORITHM_MIN_MAX_SSCRISK_CEL_OR_SPROUT namespace sprout { namespace fit { diff --git a/sprout/algorithm/fit/set_difference.hpp b/sprout/algorithm/fit/set_difference.hpp index 4ba9f45b..f73a8b8f 100644 --- a/sprout/algorithm/fit/set_difference.hpp +++ b/sprout/algorithm/fit/set_difference.hpp @@ -10,7 +10,7 @@ #include #include #include -#include HDR_ALGORITHM_SSCRISK_CEL_OR_SPROUT +#include HDR_ALGORITHM_MIN_MAX_SSCRISK_CEL_OR_SPROUT #include namespace sprout { diff --git a/sprout/algorithm/fit/set_intersection.hpp b/sprout/algorithm/fit/set_intersection.hpp index f70913ea..90b7bfdd 100644 --- a/sprout/algorithm/fit/set_intersection.hpp +++ b/sprout/algorithm/fit/set_intersection.hpp @@ -9,7 +9,7 @@ #include #include #include -#include HDR_ALGORITHM_SSCRISK_CEL_OR_SPROUT +#include HDR_ALGORITHM_MIN_MAX_SSCRISK_CEL_OR_SPROUT #include namespace sprout { diff --git a/sprout/algorithm/fit/set_symmetric_difference.hpp b/sprout/algorithm/fit/set_symmetric_difference.hpp index 4c214333..6088a471 100644 --- a/sprout/algorithm/fit/set_symmetric_difference.hpp +++ b/sprout/algorithm/fit/set_symmetric_difference.hpp @@ -10,7 +10,7 @@ #include #include #include -#include HDR_ALGORITHM_SSCRISK_CEL_OR_SPROUT +#include HDR_ALGORITHM_MIN_MAX_SSCRISK_CEL_OR_SPROUT #include namespace sprout { diff --git a/sprout/algorithm/fit/set_union.hpp b/sprout/algorithm/fit/set_union.hpp index c2e59537..19187ea9 100644 --- a/sprout/algorithm/fit/set_union.hpp +++ b/sprout/algorithm/fit/set_union.hpp @@ -10,7 +10,7 @@ #include #include #include -#include HDR_ALGORITHM_SSCRISK_CEL_OR_SPROUT +#include HDR_ALGORITHM_MIN_MAX_SSCRISK_CEL_OR_SPROUT #include namespace sprout { diff --git a/sprout/algorithm/fit/stable_partition.hpp b/sprout/algorithm/fit/stable_partition.hpp index 7c33091c..cae4b917 100644 --- a/sprout/algorithm/fit/stable_partition.hpp +++ b/sprout/algorithm/fit/stable_partition.hpp @@ -8,7 +8,7 @@ #include #include #include -#include HDR_ALGORITHM_SSCRISK_CEL_OR_SPROUT +#include HDR_ALGORITHM_MIN_MAX_SSCRISK_CEL_OR_SPROUT namespace sprout { namespace fit { diff --git a/sprout/algorithm/fit/stable_partition_copy.hpp b/sprout/algorithm/fit/stable_partition_copy.hpp index c47ebb3a..9a8b4977 100644 --- a/sprout/algorithm/fit/stable_partition_copy.hpp +++ b/sprout/algorithm/fit/stable_partition_copy.hpp @@ -8,7 +8,7 @@ #include #include #include -#include HDR_ALGORITHM_SSCRISK_CEL_OR_SPROUT +#include HDR_ALGORITHM_MIN_MAX_SSCRISK_CEL_OR_SPROUT #include namespace sprout { diff --git a/sprout/algorithm/fit/swap_element_copy.hpp b/sprout/algorithm/fit/swap_element_copy.hpp index ef4d28a4..af59e989 100644 --- a/sprout/algorithm/fit/swap_element_copy.hpp +++ b/sprout/algorithm/fit/swap_element_copy.hpp @@ -8,7 +8,7 @@ #include #include #include -#include HDR_ALGORITHM_SSCRISK_CEL_OR_SPROUT +#include HDR_ALGORITHM_MIN_MAX_SSCRISK_CEL_OR_SPROUT #include namespace sprout { diff --git a/sprout/algorithm/fit/transform.hpp b/sprout/algorithm/fit/transform.hpp index 69944ad9..674dd76e 100644 --- a/sprout/algorithm/fit/transform.hpp +++ b/sprout/algorithm/fit/transform.hpp @@ -9,7 +9,7 @@ #include #include #include -#include HDR_ALGORITHM_SSCRISK_CEL_OR_SPROUT +#include HDR_ALGORITHM_MIN_MAX_SSCRISK_CEL_OR_SPROUT #include namespace sprout { diff --git a/sprout/algorithm/fit/unfold_n.hpp b/sprout/algorithm/fit/unfold_n.hpp index 63f4900c..e8901148 100644 --- a/sprout/algorithm/fit/unfold_n.hpp +++ b/sprout/algorithm/fit/unfold_n.hpp @@ -8,7 +8,7 @@ #include #include #include -#include HDR_ALGORITHM_SSCRISK_CEL_OR_SPROUT +#include HDR_ALGORITHM_MIN_MAX_SSCRISK_CEL_OR_SPROUT namespace sprout { namespace fit { diff --git a/sprout/algorithm/fit/unique_copy.hpp b/sprout/algorithm/fit/unique_copy.hpp index 0a89453b..528aa34d 100644 --- a/sprout/algorithm/fit/unique_copy.hpp +++ b/sprout/algorithm/fit/unique_copy.hpp @@ -10,7 +10,7 @@ #include #include #include -#include HDR_ALGORITHM_SSCRISK_CEL_OR_SPROUT +#include HDR_ALGORITHM_MIN_MAX_SSCRISK_CEL_OR_SPROUT #include namespace sprout { diff --git a/sprout/brainfuck/brainfuck.hpp b/sprout/brainfuck/brainfuck.hpp index 48b9c1d9..37c1d58a 100644 --- a/sprout/brainfuck/brainfuck.hpp +++ b/sprout/brainfuck/brainfuck.hpp @@ -14,7 +14,7 @@ #include #include #include -#include HDR_ALGORITHM_SSCRISK_CEL_OR_SPROUT +#include HDR_ALGORITHM_MIN_MAX_SSCRISK_CEL_OR_SPROUT namespace sprout { namespace brainfuck { diff --git a/sprout/config/suffix.hpp b/sprout/config/suffix.hpp index 8283103b..f1850f34 100644 --- a/sprout/config/suffix.hpp +++ b/sprout/config/suffix.hpp @@ -1,6 +1,13 @@ #ifndef SPROUT_CONFIG_SUFFIX_HPP #define SPROUT_CONFIG_SUFFIX_HPP +// +// SPROUT_CONSTEXPR +// SPROUT_CONSTEXPR_OR_CONST +// SPROUT_STATIC_CONSTEXPR +// SPROUT_STATIC_CONSTEXPR_DATA_MEMBER_INNER +// SPROUT_STATIC_CONSTEXPR_DATA_MEMBER_OUTER +// #ifndef SPROUT_CONFIG_DISABLE_CONSTEXPR # define SPROUT_CONSTEXPR constexpr # define SPROUT_CONSTEXPR_OR_CONST constexpr @@ -17,6 +24,10 @@ # define SPROUT_STATIC_CONSTEXPR_DATA_MEMBER_OUTER(EXPR) = EXPR #endif // #ifndef SPROUT_CONFIG_DISABLE_CONSTEXPR +// +// SPROUT_DEFAULTED_DEFAULT_CONSTRUCTOR_DECL +// SPROUT_DEFAULTED_DESTRUCTOR_DECL +// #ifndef SPROUT_CONFIG_DISABLE_DEFAULTED_FUNCTIONS # define SPROUT_DEFAULTED_DEFAULT_CONSTRUCTOR_DECL = default; # define SPROUT_DEFAULTED_DESTRUCTOR_DECL = default; @@ -25,18 +36,29 @@ # define SPROUT_DEFAULTED_DESTRUCTOR_DECL {} #endif // #ifndef SPROUT_CONFIG_DISABLE_DEFAULTED_FUNCTIONS +// +// SPROUT_DELETED_FUNCTION_DECL +// #ifndef SPROUT_CONFIG_DISABLE_DELETED_FUNCTIONS # define SPROUT_DELETED_FUNCTION_DECL = delete; #else // #ifndef SPROUT_CONFIG_DISABLE_DELETED_FUNCTIONS # define SPROUT_DELETED_FUNCTION_DECL ; #endif // #ifndef SPROUT_CONFIG_DISABLE_DELETED_FUNCTIONS +// +// SPROUT_USE_EXPLICIT_CONVERSION_OPERATORS +// #ifndef SPROUT_CONFIG_DISABLE_EXPLICIT_CONVERSION_OPERATORS # define SPROUT_USE_EXPLICIT_CONVERSION_OPERATORS 1 #else // #ifndef SPROUT_CONFIG_DISABLE_EXPLICIT_CONVERSION_OPERATORS # define SPROUT_USE_EXPLICIT_CONVERSION_OPERATORS 0 #endif // #ifndef SPROUT_CONFIG_DISABLE_EXPLICIT_CONVERSION_OPERATORS +// +// SPROUT_NOEXCEPT +// SPROUT_NOEXCEPT_EXPR +// SPROUT_NOEXCEPT_EXPR_OR_DEFAULT +// #ifndef SPROUT_CONFIG_DISABLE_NOEXCEPT # define SPROUT_NOEXCEPT noexcept # define SPROUT_NOEXCEPT_EXPR(EXPR) noexcept(EXPR) @@ -47,62 +69,72 @@ # define SPROUT_NOEXCEPT_EXPR_OR_DEFAULT(EXPR, C) C #endif // #ifndef SPROUT_CONFIG_DISABLE_NOEXCEPT +// +// SPROUT_USE_TEMPLATE_ALIASES +// #ifndef SPROUT_CONFIG_DISABLE_TEMPLATE_ALIASES # define SPROUT_USE_TEMPLATE_ALIASES 1 #else // #ifndef SPROUT_CONFIG_DISABLE_TEMPLATE_ALIASES # define SPROUT_USE_TEMPLATE_ALIASES 0 #endif // #ifndef SPROUT_CONFIG_DISABLE_TEMPLATE_ALIASES +// +// SPROUT_USE_USER_DEFINED_LITERALS +// #ifndef SPROUT_CONFIG_DISABLE_USER_DEFINED_LITERALS # define SPROUT_USE_USER_DEFINED_LITERALS 1 #else // #ifndef SPROUT_CONFIG_DISABLE_USER_DEFINED_LITERALS # define SPROUT_USE_USER_DEFINED_LITERALS 0 #endif // #ifndef SPROUT_CONFIG_DISABLE_USER_DEFINED_LITERALS +// +// SPROUT_USE_DELEGATING_CONSTRUCTORS +// #ifndef SPROUT_CONFIG_DISABLE_DELEGATING_CONSTRUCTORS # define SPROUT_USE_DELEGATING_CONSTRUCTORS 1 #else // #ifndef SPROUT_CONFIG_DISABLE_DELEGATING_CONSTRUCTORS # define SPROUT_USE_DELEGATING_CONSTRUCTORS 0 #endif // #ifndef SPROUT_CONFIG_DISABLE_DELEGATING_CONSTRUCTORS +// +// SPROUT_USE_UNICODE_LITERALS +// #ifndef SPROUT_CONFIG_DISABLE_UNICODE_LITERALS # define SPROUT_USE_UNICODE_LITERALS 1 #else // #ifndef SPROUT_CONFIG_DISABLE_UNICODE_LITERALS # define SPROUT_USE_UNICODE_LITERALS 0 #endif // #ifndef SPROUT_CONFIG_DISABLE_UNICODE_LITERALS -#ifndef SPROUT_CONFIG_USE_SSCRISK_CEL -# define HDR_FUNCTIONAL_SSCRISK_CEL_OR_SPROUT -# define HDR_ALGORITHM_SSCRISK_CEL_OR_SPROUT -# define HDR_NUMERIC_SSCRISK_CEL_OR_SPROUT -# define HDR_ITERATOR_SSCRISK_CEL_OR_SPROUT -# define NS_SSCRISK_CEL_OR_SPROUT sprout -#else // #ifndef SPROUT_CONFIG_USE_SSCRISK_CEL -# define HDR_FUNCTIONAL_SSCRISK_CEL_OR_SPROUT -# define HDR_ALGORITHM_SSCRISK_CEL_OR_SPROUT -# define HDR_NUMERIC_SSCRISK_CEL_OR_SPROUT -# define HDR_ITERATOR_SSCRISK_CEL_OR_SPROUT -# define NS_SSCRISK_CEL_OR_SPROUT sscrisk::cel -#endif // #ifndef SPROUT_CONFIG_USE_SSCRISK_CEL - +// +// SPROUT_USE_BUILTIN_CMATH_FUNCTION +// #ifndef SPROUT_CONFIG_DISABLE_BUILTIN_CMATH_FUNCTION # define SPROUT_USE_BUILTIN_CMATH_FUNCTION 1 #else // #ifndef SPROUT_CONFIG_DISABLE_BUILTIN_CMATH_FUNCTION # define SPROUT_USE_BUILTIN_CMATH_FUNCTION 0 #endif // #ifndef SPROUT_CONFIG_DISABLE_BUILTIN_CMATH_FUNCTION +// +// SPROUT_USE_BUILTIN_BIT_OPERATION +// #ifndef SPROUT_CONFIG_DISABLE_BUILTIN_BIT_OPERATION # define SPROUT_USE_BUILTIN_BIT_OPERATION 1 #else // #ifndef SPROUT_CONFIG_DISABLE_BUILTIN_BIT_OPERATION # define SPROUT_USE_BUILTIN_BIT_OPERATION 0 #endif // #ifndef SPROUT_CONFIG_DISABLE_BUILTIN_BIT_OPERATION +// +// SPROUT_NOERROR_LARGE_FLOAT_ROUNDING +// #ifndef SPROUT_CONFIG_DISABLE_LARGE_FLOAT_ROUNDING # define SPROUT_NOERROR_LARGE_FLOAT_ROUNDING 1 #else // #ifndef SPROUT_CONFIG_DISABLE_LARGE_FLOAT_ROUNDING # define SPROUT_NOERROR_LARGE_FLOAT_ROUNDING 0 #endif // #ifndef SPROUT_CONFIG_DISABLE_LARGE_FLOAT_ROUNDING +// +// SPROUT_USE_INDEX_ITERATOR_IMPLEMENTATION +// #ifndef SPROUT_CONFIG_DISABLE_SUPPORT_TEMPORARY_CONTAINER_ITERATION # define SPROUT_USE_INDEX_ITERATOR_IMPLEMENTATION 1 #else // #ifndef SPROUT_CONFIG_DISABLE_SUPPORT_TEMPORARY_CONTAINER_ITERATION @@ -112,10 +144,28 @@ # define SPROUT_USE_INDEX_ITERATOR_IMPLEMENTATION 0 #endif // #ifndef SPROUT_CONFIG_DISABLE_SUPPORT_TEMPORARY_CONTAINER_ITERATION +// +// SPROUT_USE_PTR_INDEX_ITERATOR_IMPLEMENTATION +// #ifndef SPROUT_CONFIG_DISABLE_SUPPORT_EFFICIENT_ARRAY_ITERATION # define SPROUT_USE_PTR_INDEX_ITERATOR_IMPLEMENTATION 1 #else // #ifndef SPROUT_CONFIG_DISABLE_SUPPORT_EFFICIENT_ARRAY_ITERATION # define SPROUT_USE_PTR_INDEX_ITERATOR_IMPLEMENTATION 0 #endif // #ifndef SPROUT_CONFIG_DISABLE_SUPPORT_EFFICIENT_ARRAY_ITERATION +// +// HDR_FUNCTIONAL_SSCRISK_CEL_OR_SPROUT +// HDR_ALGORITHM_MIN_MAX_SSCRISK_CEL_OR_SPROUT +// NS_SSCRISK_CEL_OR_SPROUT +// +#ifndef SPROUT_CONFIG_USE_SSCRISK_CEL +# define HDR_FUNCTIONAL_SSCRISK_CEL_OR_SPROUT +# define HDR_ALGORITHM_MIN_MAX_SSCRISK_CEL_OR_SPROUT +# define NS_SSCRISK_CEL_OR_SPROUT sprout +#else // #ifndef SPROUT_CONFIG_USE_SSCRISK_CEL +# define HDR_FUNCTIONAL_SSCRISK_CEL_OR_SPROUT +# define HDR_ALGORITHM_MIN_MAX_SSCRISK_CEL_OR_SPROUT +# define NS_SSCRISK_CEL_OR_SPROUT sscrisk::cel +#endif // #ifndef SPROUT_CONFIG_USE_SSCRISK_CEL + #endif // #ifndef SPROUT_CONFIG_SUFFIX_HPP diff --git a/sprout/darkroom/lights/parallel_light.hpp b/sprout/darkroom/lights/parallel_light.hpp index c14856d1..db3ff5eb 100644 --- a/sprout/darkroom/lights/parallel_light.hpp +++ b/sprout/darkroom/lights/parallel_light.hpp @@ -10,7 +10,7 @@ #include #include #include -#include HDR_ALGORITHM_SSCRISK_CEL_OR_SPROUT +#include HDR_ALGORITHM_MIN_MAX_SSCRISK_CEL_OR_SPROUT namespace sprout { namespace darkroom { diff --git a/sprout/darkroom/lights/point_light.hpp b/sprout/darkroom/lights/point_light.hpp index a6824ddb..551c9364 100644 --- a/sprout/darkroom/lights/point_light.hpp +++ b/sprout/darkroom/lights/point_light.hpp @@ -10,7 +10,7 @@ #include #include #include -#include HDR_ALGORITHM_SSCRISK_CEL_OR_SPROUT +#include HDR_ALGORITHM_MIN_MAX_SSCRISK_CEL_OR_SPROUT namespace sprout { namespace darkroom { diff --git a/sprout/detail/algorithm_min_max.hpp b/sprout/detail/algorithm_min_max.hpp new file mode 100644 index 00000000..12780afb --- /dev/null +++ b/sprout/detail/algorithm_min_max.hpp @@ -0,0 +1,8 @@ +#ifndef SPROUT_DETAIL_ALGORITHM_MIN_MAX_HPP +#define SPROUT_DETAIL_ALGORITHM_MIN_MAX_HPP + +#include +#include +#include + +#endif // #ifndef SPROUT_DETAIL_ALGORITHM_MIN_MAX_HPP diff --git a/sprout/functional/hash/detail/hash_float.hpp b/sprout/functional/hash/detail/hash_float.hpp index 2f62d2e9..1d0bcc77 100644 --- a/sprout/functional/hash/detail/hash_float.hpp +++ b/sprout/functional/hash/detail/hash_float.hpp @@ -71,7 +71,7 @@ namespace sprout { inline SPROUT_CONSTEXPR std::size_t float_hash_value(T v) { return sprout::detail::float_hash_value_1(v, sprout::math::fpclassify(v)); - } + } } // namespace detail } // namespace sprout diff --git a/sprout/io.hpp b/sprout/io.hpp index a3cc5bc2..2dc18b91 100644 --- a/sprout/io.hpp +++ b/sprout/io.hpp @@ -16,7 +16,7 @@ #include #include #include -#include HDR_ALGORITHM_SSCRISK_CEL_OR_SPROUT +#include HDR_ALGORITHM_MIN_MAX_SSCRISK_CEL_OR_SPROUT namespace sprout { namespace io { diff --git a/sprout/iterator/remake_iterator.hpp b/sprout/iterator/remake_iterator.hpp index 18417c96..e11d2e75 100644 --- a/sprout/iterator/remake_iterator.hpp +++ b/sprout/iterator/remake_iterator.hpp @@ -9,7 +9,7 @@ #include #include #include -#include HDR_ALGORITHM_SSCRISK_CEL_OR_SPROUT +#include HDR_ALGORITHM_MIN_MAX_SSCRISK_CEL_OR_SPROUT namespace sprout { // diff --git a/sprout/iterator/step_iterator.hpp b/sprout/iterator/step_iterator.hpp index fba00476..31f5b836 100644 --- a/sprout/iterator/step_iterator.hpp +++ b/sprout/iterator/step_iterator.hpp @@ -9,7 +9,7 @@ #include #include #include -#include HDR_ALGORITHM_SSCRISK_CEL_OR_SPROUT +#include HDR_ALGORITHM_MIN_MAX_SSCRISK_CEL_OR_SPROUT namespace sprout { // diff --git a/sprout/numeric/dft/fit/amplitude_spectrum.hpp b/sprout/numeric/dft/fit/amplitude_spectrum.hpp index c88c576d..aece647d 100644 --- a/sprout/numeric/dft/fit/amplitude_spectrum.hpp +++ b/sprout/numeric/dft/fit/amplitude_spectrum.hpp @@ -10,7 +10,7 @@ #include #include #include -#include HDR_ALGORITHM_SSCRISK_CEL_OR_SPROUT +#include HDR_ALGORITHM_MIN_MAX_SSCRISK_CEL_OR_SPROUT #include namespace sprout { diff --git a/sprout/numeric/dft/fit/dft.hpp b/sprout/numeric/dft/fit/dft.hpp index 2aaa1267..b6ca95e9 100644 --- a/sprout/numeric/dft/fit/dft.hpp +++ b/sprout/numeric/dft/fit/dft.hpp @@ -10,7 +10,7 @@ #include #include #include -#include HDR_ALGORITHM_SSCRISK_CEL_OR_SPROUT +#include HDR_ALGORITHM_MIN_MAX_SSCRISK_CEL_OR_SPROUT namespace sprout { namespace fit { diff --git a/sprout/numeric/dft/fit/idft.hpp b/sprout/numeric/dft/fit/idft.hpp index 6534635d..4c598c66 100644 --- a/sprout/numeric/dft/fit/idft.hpp +++ b/sprout/numeric/dft/fit/idft.hpp @@ -10,7 +10,7 @@ #include #include #include -#include HDR_ALGORITHM_SSCRISK_CEL_OR_SPROUT +#include HDR_ALGORITHM_MIN_MAX_SSCRISK_CEL_OR_SPROUT namespace sprout { namespace fit { diff --git a/sprout/numeric/dft/fit/phase_spectrum.hpp b/sprout/numeric/dft/fit/phase_spectrum.hpp index cc6650f9..e2b6166f 100644 --- a/sprout/numeric/dft/fit/phase_spectrum.hpp +++ b/sprout/numeric/dft/fit/phase_spectrum.hpp @@ -10,7 +10,7 @@ #include #include #include -#include HDR_ALGORITHM_SSCRISK_CEL_OR_SPROUT +#include HDR_ALGORITHM_MIN_MAX_SSCRISK_CEL_OR_SPROUT #include namespace sprout { diff --git a/sprout/numeric/fit/adjacent_difference.hpp b/sprout/numeric/fit/adjacent_difference.hpp index 946ea6ff..f4ac4324 100644 --- a/sprout/numeric/fit/adjacent_difference.hpp +++ b/sprout/numeric/fit/adjacent_difference.hpp @@ -9,7 +9,7 @@ #include #include #include -#include HDR_ALGORITHM_SSCRISK_CEL_OR_SPROUT +#include HDR_ALGORITHM_MIN_MAX_SSCRISK_CEL_OR_SPROUT #include namespace sprout { diff --git a/sprout/numeric/fit/partial_sum.hpp b/sprout/numeric/fit/partial_sum.hpp index 994600c7..e65abe38 100644 --- a/sprout/numeric/fit/partial_sum.hpp +++ b/sprout/numeric/fit/partial_sum.hpp @@ -9,7 +9,7 @@ #include #include #include -#include HDR_ALGORITHM_SSCRISK_CEL_OR_SPROUT +#include HDR_ALGORITHM_MIN_MAX_SSCRISK_CEL_OR_SPROUT #include namespace sprout { diff --git a/sprout/random/detail/uniform_int_float.hpp b/sprout/random/detail/uniform_int_float.hpp index dc865c8b..12fd0560 100644 --- a/sprout/random/detail/uniform_int_float.hpp +++ b/sprout/random/detail/uniform_int_float.hpp @@ -8,7 +8,7 @@ #include #include #include -#include HDR_ALGORITHM_SSCRISK_CEL_OR_SPROUT +#include HDR_ALGORITHM_MIN_MAX_SSCRISK_CEL_OR_SPROUT namespace sprout { namespace random { diff --git a/sprout/random/xor_combine.hpp b/sprout/random/xor_combine.hpp index 38c68a57..70fb5a90 100644 --- a/sprout/random/xor_combine.hpp +++ b/sprout/random/xor_combine.hpp @@ -5,7 +5,7 @@ #include #include #include -#include HDR_ALGORITHM_SSCRISK_CEL_OR_SPROUT +#include HDR_ALGORITHM_MIN_MAX_SSCRISK_CEL_OR_SPROUT namespace sprout { namespace random { diff --git a/sprout/range/adaptor/alternated.hpp b/sprout/range/adaptor/alternated.hpp index c9603d7d..37c8d592 100644 --- a/sprout/range/adaptor/alternated.hpp +++ b/sprout/range/adaptor/alternated.hpp @@ -12,7 +12,7 @@ #include #include #include -#include HDR_ALGORITHM_SSCRISK_CEL_OR_SPROUT +#include HDR_ALGORITHM_MIN_MAX_SSCRISK_CEL_OR_SPROUT namespace sprout { namespace adaptors { diff --git a/sprout/range/adaptor/blanked.hpp b/sprout/range/adaptor/blanked.hpp index e758df94..2627d623 100644 --- a/sprout/range/adaptor/blanked.hpp +++ b/sprout/range/adaptor/blanked.hpp @@ -11,7 +11,7 @@ #include #include #include -#include HDR_ALGORITHM_SSCRISK_CEL_OR_SPROUT +#include HDR_ALGORITHM_MIN_MAX_SSCRISK_CEL_OR_SPROUT namespace sprout { // diff --git a/sprout/range/adaptor/dropped.hpp b/sprout/range/adaptor/dropped.hpp index 2c7c91ea..2a8e73c9 100644 --- a/sprout/range/adaptor/dropped.hpp +++ b/sprout/range/adaptor/dropped.hpp @@ -9,7 +9,7 @@ #include #include #include -#include HDR_ALGORITHM_SSCRISK_CEL_OR_SPROUT +#include HDR_ALGORITHM_MIN_MAX_SSCRISK_CEL_OR_SPROUT namespace sprout { namespace adaptors { diff --git a/sprout/range/adaptor/dropped_end.hpp b/sprout/range/adaptor/dropped_end.hpp index b489817c..43b88f10 100644 --- a/sprout/range/adaptor/dropped_end.hpp +++ b/sprout/range/adaptor/dropped_end.hpp @@ -9,7 +9,7 @@ #include #include #include -#include HDR_ALGORITHM_SSCRISK_CEL_OR_SPROUT +#include HDR_ALGORITHM_MIN_MAX_SSCRISK_CEL_OR_SPROUT namespace sprout { namespace adaptors { diff --git a/sprout/range/adaptor/offset.hpp b/sprout/range/adaptor/offset.hpp index fda6b46c..3454bf1b 100644 --- a/sprout/range/adaptor/offset.hpp +++ b/sprout/range/adaptor/offset.hpp @@ -10,7 +10,7 @@ #include #include #include -#include HDR_ALGORITHM_SSCRISK_CEL_OR_SPROUT +#include HDR_ALGORITHM_MIN_MAX_SSCRISK_CEL_OR_SPROUT namespace sprout { namespace adaptors { diff --git a/sprout/range/adaptor/steps.hpp b/sprout/range/adaptor/steps.hpp index 1ba45ec2..0cbf57fb 100644 --- a/sprout/range/adaptor/steps.hpp +++ b/sprout/range/adaptor/steps.hpp @@ -10,7 +10,7 @@ #include #include #include -#include HDR_ALGORITHM_SSCRISK_CEL_OR_SPROUT +#include HDR_ALGORITHM_MIN_MAX_SSCRISK_CEL_OR_SPROUT namespace sprout { namespace adaptors { diff --git a/sprout/range/adaptor/taken.hpp b/sprout/range/adaptor/taken.hpp index b7851839..019b688d 100644 --- a/sprout/range/adaptor/taken.hpp +++ b/sprout/range/adaptor/taken.hpp @@ -9,7 +9,7 @@ #include #include #include -#include HDR_ALGORITHM_SSCRISK_CEL_OR_SPROUT +#include HDR_ALGORITHM_MIN_MAX_SSCRISK_CEL_OR_SPROUT namespace sprout { namespace adaptors { diff --git a/sprout/range/adaptor/taken_end.hpp b/sprout/range/adaptor/taken_end.hpp index e8ae7cae..f8c84048 100644 --- a/sprout/range/adaptor/taken_end.hpp +++ b/sprout/range/adaptor/taken_end.hpp @@ -9,7 +9,7 @@ #include #include #include -#include HDR_ALGORITHM_SSCRISK_CEL_OR_SPROUT +#include HDR_ALGORITHM_MIN_MAX_SSCRISK_CEL_OR_SPROUT namespace sprout { namespace adaptors { diff --git a/sprout/range/adaptor/window.hpp b/sprout/range/adaptor/window.hpp index f2d5ba04..9ee517d5 100644 --- a/sprout/range/adaptor/window.hpp +++ b/sprout/range/adaptor/window.hpp @@ -10,7 +10,7 @@ #include #include #include -#include HDR_ALGORITHM_SSCRISK_CEL_OR_SPROUT +#include HDR_ALGORITHM_MIN_MAX_SSCRISK_CEL_OR_SPROUT namespace sprout { namespace adaptors { diff --git a/sprout/string/char_traits.hpp b/sprout/string/char_traits.hpp index f2bfccef..2c630de3 100644 --- a/sprout/string/char_traits.hpp +++ b/sprout/string/char_traits.hpp @@ -2,8 +2,8 @@ #define SPROUT_STRING_CHAR_TRAITS_HPP #include -#include #include +#include #include #include #include @@ -13,6 +13,36 @@ #include namespace sprout { + namespace detail { + template + class char_traits_eq { + public: + typedef Traits traits_type; + typedef typename traits_type::char_type char_type; + typedef bool result_type; + typedef char_type first_argument_type; + typedef char_type second_argument_type; + public: + SPROUT_CONSTEXPR bool operator()(char_type c1, char_type c2) const SPROUT_NOEXCEPT { + return traits_type::eq(c1, c2); + } + }; + + template + class char_traits_lt { + public: + typedef Traits traits_type; + typedef typename traits_type::char_type char_type; + typedef bool result_type; + typedef char_type first_argument_type; + typedef char_type second_argument_type; + public: + SPROUT_CONSTEXPR bool operator()(char_type c1, char_type c2) const SPROUT_NOEXCEPT { + return traits_type::lt(c1, c2); + } + }; + } // namespace detail + // // char_traits // @@ -26,19 +56,6 @@ namespace sprout { typedef typename impl_type::off_type off_type; typedef typename impl_type::pos_type pos_type; typedef typename impl_type::state_type state_type; - private: - struct eq_ { - public: - SPROUT_CONSTEXPR bool operator()(char_type c1, char_type c2) const SPROUT_NOEXCEPT { - return eq(c1, c2); - } - }; - struct lt_ { - public: - SPROUT_CONSTEXPR bool operator()(char_type c1, char_type c2) const SPROUT_NOEXCEPT { - return lt(c1, c2); - } - }; private: static SPROUT_CONSTEXPR char_type const* find_impl(char_type const* found, char_type const* last) { return found == last ? nullptr @@ -59,18 +76,18 @@ namespace sprout { return sprout::tristate_lexicographical_compare( sprout::as_iterator(s1), sprout::as_iterator(s1, n), char_type(), sprout::as_iterator(s2), sprout::as_iterator(s2, n), char_type(), - lt_() + sprout::detail::char_traits_lt() ); } static SPROUT_CONSTEXPR std::size_t length(char_type const* s) { - return sprout::detail::strlen(s); + return sprout::strlen(s); } static SPROUT_CONSTEXPR char_type const* find(char_type const* s, std::size_t n, char_type const& a) { return find_impl( sprout::as_iterator_base( sprout::find_if( sprout::as_iterator(s), sprout::as_iterator(s, n), - sprout::bind2nd(eq_(), a) + sprout::bind2nd(sprout::detail::char_traits_eq(), a) ) ), s + n @@ -106,7 +123,7 @@ namespace sprout { return sprout::tristate_lexicographical_compare( sprout::as_iterator(s1), sprout::as_iterator(s1, n), char_type(), s2, s2 + n, char_type(), - lt_() + sprout::detail::char_traits_lt() ); } template @@ -114,7 +131,7 @@ namespace sprout { return sprout::tristate_lexicographical_compare( s1, s1 + n, char_type(), sprout::as_iterator(s2), sprout::as_iterator(s2, n), char_type(), - lt_() + sprout::detail::char_traits_lt() ); } template @@ -122,7 +139,7 @@ namespace sprout { return sprout::tristate_lexicographical_compare( s1, s1 + n, char_type(), s2, s2 + n, char_type(), - lt_() + sprout::detail::char_traits_lt() ); } template @@ -134,7 +151,7 @@ namespace sprout { return sprout::as_iterator_base( sprout::find_if( s, s + n, - sprout::bind2nd(eq_(), a) + sprout::bind2nd(sprout::detail::char_traits_eq(), a) ) ); } @@ -168,25 +185,15 @@ namespace sprout { typedef typename traits_type::off_type off_type; typedef typename traits_type::pos_type pos_type; typedef typename traits_type::state_type state_type; - private: - struct eq_ { - public: - SPROUT_CONSTEXPR bool operator()(char_type c1, char_type c2) const SPROUT_NOEXCEPT { - return traits_type::eq(c1, c2); - } - }; public: static SPROUT_CONSTEXPR std::size_t length(char_type const* s, std::size_t n) { - return sprout::distance( - sprout::as_iterator(s), - find(sprout::as_iterator(s), n, char_type()) - ); + return sprout::strlen(s, n); } static SPROUT_CONSTEXPR char_type const* find(char_type const* s, std::size_t n, char_type const& a) { return sprout::as_iterator_base( sprout::find_if( sprout::as_iterator(s), sprout::as_iterator(s, n), - sprout::bind2nd(eq_(), a) + sprout::bind2nd(sprout::detail::char_traits_eq(), a) ) ); } @@ -196,16 +203,13 @@ namespace sprout { #if SPROUT_USE_INDEX_ITERATOR_IMPLEMENTATION template static SPROUT_CONSTEXPR std::size_t length(ConstIterator s, std::size_t n) { - return sprout::distance( - s, - find(s, n, char_type()) - ); + return sprout::detail::strlen(s, n); } template static SPROUT_CONSTEXPR ConstIterator find(ConstIterator s, std::size_t n, char_type const& a) { return sprout::find_if( s, s + n, - sprout::bind2nd(eq_(), a) + sprout::bind2nd(sprout::detail::char_traits_eq(), a) ); } template diff --git a/sprout/string/detail/compare.hpp b/sprout/string/detail/compare.hpp index f1ed197b..de42cd80 100644 --- a/sprout/string/detail/compare.hpp +++ b/sprout/string/detail/compare.hpp @@ -2,7 +2,7 @@ #define SPROUT_STRING_DETAIL_COMPARE_HPP #include -#include HDR_ALGORITHM_SSCRISK_CEL_OR_SPROUT +#include HDR_ALGORITHM_MIN_MAX_SSCRISK_CEL_OR_SPROUT namespace sprout { namespace string_detail { diff --git a/sprout/string/detail/find.hpp b/sprout/string/detail/find.hpp index 34cb1a8b..8cdadaa3 100644 --- a/sprout/string/detail/find.hpp +++ b/sprout/string/detail/find.hpp @@ -3,7 +3,7 @@ #include #include -#include HDR_ALGORITHM_SSCRISK_CEL_OR_SPROUT +#include HDR_ALGORITHM_MIN_MAX_SSCRISK_CEL_OR_SPROUT namespace sprout { namespace string_detail { diff --git a/sprout/string/float_to_string.hpp b/sprout/string/float_to_string.hpp index 510a5231..7f15052d 100644 --- a/sprout/string/float_to_string.hpp +++ b/sprout/string/float_to_string.hpp @@ -12,7 +12,7 @@ #include #include #include -#include HDR_ALGORITHM_SSCRISK_CEL_OR_SPROUT +#include HDR_ALGORITHM_MIN_MAX_SSCRISK_CEL_OR_SPROUT namespace sprout { namespace detail { diff --git a/sprout/string/shrink.hpp b/sprout/string/shrink.hpp index 3fdcdd16..ed4e0abb 100644 --- a/sprout/string/shrink.hpp +++ b/sprout/string/shrink.hpp @@ -7,7 +7,7 @@ #include #include #include -#include HDR_ALGORITHM_SSCRISK_CEL_OR_SPROUT +#include HDR_ALGORITHM_MIN_MAX_SSCRISK_CEL_OR_SPROUT namespace sprout { // diff --git a/sprout/string/string.hpp b/sprout/string/string.hpp index a42df432..e0f75657 100644 --- a/sprout/string/string.hpp +++ b/sprout/string/string.hpp @@ -2,6 +2,7 @@ #define SPROUT_STRING_STRING_HPP #include +#include #include #include #include @@ -18,7 +19,7 @@ #include #include #include -#include HDR_ALGORITHM_SSCRISK_CEL_OR_SPROUT +#include HDR_ALGORITHM_MIN_MAX_SSCRISK_CEL_OR_SPROUT #if SPROUT_USE_INDEX_ITERATOR_IMPLEMENTATION # include #endif @@ -89,15 +90,18 @@ namespace sprout { return sprout::basic_string{{(Indexes < M - 1 ? elems[Indexes] : T())...}, len}; } public: - static SPROUT_CONSTEXPR basic_string from_c_str(value_type const* s, size_type n) { + static SPROUT_CONSTEXPR basic_string from_c_str(T const* s, size_type n) { return !(N < n) ? from_c_str_impl(s, n, sprout::index_range<0, N>::make()) : throw std::out_of_range("basic_string<>: index out of range") ; } - static SPROUT_CONSTEXPR basic_string from_c_str(value_type const* s) { + static SPROUT_CONSTEXPR basic_string from_c_str(T const* s) { return from_c_str(s, traits_type::length(s)); } + static SPROUT_CONSTEXPR basic_string from_c_str(std::basic_string const& s) { + return from_c_str(s.data(), s.size()); + } public: value_type elems[static_size + 1]; size_type len; @@ -489,6 +493,12 @@ namespace sprout { sprout::index_range<0, N2>::make() ); } +#if SPROUT_USE_EXPLICIT_CONVERSION_OPERATORS + template + explicit operator std::basic_string() const { + return std::basic_string(data(), size()); + } +#endif pointer c_array() SPROUT_NOEXCEPT { return &elems[0]; @@ -693,18 +703,12 @@ namespace sprout { template static SPROUT_CONSTEXPR typename copied_type::size_type length_impl(sprout::array const& arr) { - return sprout::distance( - arr.begin(), - sprout::find(arr.begin(), arr.end(), T()) - ); + return sprout::distance(arr.begin(), sprout::find(arr.begin(), arr.end(), T())); } template static SPROUT_CONSTEXPR copied_type make_impl(typename copied_type::size_type size, sprout::index_tuple, Args&&... args) { - return copied_type{ - {(Indexes < size ? sprout::forward(args) : T())...}, - size - }; + return copied_type{{(Indexes < size ? sprout::forward(args) : T())...}, size}; } public: template @@ -743,11 +747,11 @@ namespace sprout { { return sprout::basic_string{{(Indexes < n ? arr[Indexes] : T())...}, n}; } - template + template inline SPROUT_CONSTEXPR sprout::basic_string - to_string_impl(T const(& arr)[N], sprout::index_tuple) { - typedef sprout::char_traits_helper > traits_type; - return to_string_impl_1(arr, traits_type::length(arr, N - 1), sprout::index_tuple()); + to_string_impl(T const(& arr)[N]) { + typedef sprout::char_traits_helper::traits_type> helper_type; + return to_string_impl_1(arr, helper_type::length(arr, N - 1), sprout::index_range<0, N - 1>::make()); } } // namespace detail // @@ -761,7 +765,7 @@ namespace sprout { template inline SPROUT_CONSTEXPR sprout::basic_string to_string(T const(& arr)[N]) { - return sprout::detail::to_string_impl(arr, sprout::index_range<0, N - 1>::make()); + return sprout::detail::to_string_impl(arr); } // @@ -777,6 +781,11 @@ namespace sprout { string_from_c_str(T const* s) { return sprout::basic_string::from_c_str(s); } + template + inline SPROUT_CONSTEXPR sprout::basic_string + string_from_c_str(std::basic_string const& s) { + return sprout::basic_string::from_c_str(s); + } } // namespace sprout #endif // #ifndef SPROUT_STRING_STRING_HPP diff --git a/sprout/utility/string_ref/string_ref.hpp b/sprout/utility/string_ref/string_ref.hpp index da1754e8..e5b204dc 100644 --- a/sprout/utility/string_ref/string_ref.hpp +++ b/sprout/utility/string_ref/string_ref.hpp @@ -13,7 +13,7 @@ #include #include #include -#include HDR_ALGORITHM_SSCRISK_CEL_OR_SPROUT +#include HDR_ALGORITHM_MIN_MAX_SSCRISK_CEL_OR_SPROUT #if SPROUT_USE_INDEX_ITERATOR_IMPLEMENTATION # include #endif @@ -554,6 +554,11 @@ namespace sprout { // // to_string_ref // + template + inline SPROUT_CONSTEXPR sprout::basic_string_ref + to_string_ref(sprout::basic_string_ref const& s) { + return s; + } template inline SPROUT_CONSTEXPR sprout::basic_string_ref to_string_ref(sprout::basic_string const& s) {