workaroud for clang3.2 (shuffle, shuffle_result)

This commit is contained in:
bolero-MURAKAMI 2012-11-14 10:56:22 +09:00
parent 2ddd4014ce
commit d39f4abe0f
4 changed files with 40 additions and 8 deletions

View file

@ -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