mirror of
https://github.com/bolero-MURAKAMI/Sprout.git
synced 2025-07-12 14:54:10 +00:00
workaroud for clang3.2 (shuffle, shuffle_result)
This commit is contained in:
parent
2ddd4014ce
commit
d39f4abe0f
4 changed files with 40 additions and 8 deletions
|
@ -10,7 +10,13 @@
|
|||
#include <sprout/utility/forward.hpp>
|
||||
#include <sprout/algorithm/fixed/result_of.hpp>
|
||||
#include <sprout/algorithm/fixed/swap_element.hpp>
|
||||
#include <sprout/random/uniform_int_distribution.hpp>
|
||||
#ifdef SPROUT_WORKAROUND_NOT_TERMINATE_RECURSIVE_CONSTEXPR_FUNCTION_TEMPLATE
|
||||
# include <sprout/random/uniform_smallint.hpp>
|
||||
# define SPROUT_WORKAROUND_UNIFORM_INT_DISTRIBUTION sprout::random::uniform_smallint
|
||||
#else
|
||||
# include <sprout/random/uniform_int_distribution.hpp>
|
||||
# define SPROUT_WORKAROUND_UNIFORM_INT_DISTRIBUTION sprout::random::uniform_int_distribution
|
||||
#endif
|
||||
|
||||
namespace sprout {
|
||||
namespace fixed {
|
||||
|
@ -33,7 +39,7 @@ namespace sprout {
|
|||
make_random_swap_indexes(std::ptrdiff_t n, UniformRandomNumberGenerator&& g) {
|
||||
return n > 1
|
||||
? sprout::fixed::detail::make_random_swap_indexes_1(
|
||||
sprout::random::uniform_int_distribution<std::ptrdiff_t>(0, n - 1)(sprout::forward<UniformRandomNumberGenerator>(g))
|
||||
SPROUT_WORKAROUND_UNIFORM_INT_DISTRIBUTION<std::ptrdiff_t>(0, n - 1)(sprout::forward<UniformRandomNumberGenerator>(g))
|
||||
)
|
||||
: sprout::array<std::ptrdiff_t, 2>{{}}
|
||||
;
|
||||
|
@ -82,4 +88,6 @@ namespace sprout {
|
|||
using sprout::fixed::random_swap;
|
||||
} // namespace sprout
|
||||
|
||||
#undef SPROUT_WORKAROUND_UNIFORM_INT_DISTRIBUTION
|
||||
|
||||
#endif // #ifndef SPROUT_ALGORITHM_FIXED_RANDOM_SWAP_HPP
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue