2014-01-16 09:59:25 +00:00
|
|
|
/*=============================================================================
|
2018-12-30 08:25:21 +00:00
|
|
|
Copyright (c) 2011-2018 Bolero MURAKAMI
|
2014-01-16 09:59:25 +00:00
|
|
|
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)
|
|
|
|
=============================================================================*/
|
2014-01-17 13:09:08 +00:00
|
|
|
#ifndef SPROUT_RANDOM_RESULTS_HPP
|
|
|
|
#define SPROUT_RANDOM_RESULTS_HPP
|
2014-01-16 09:59:25 +00:00
|
|
|
|
|
|
|
#include <utility>
|
|
|
|
#include <sprout/config.hpp>
|
|
|
|
#include <sprout/generator/functions.hpp>
|
|
|
|
#include <sprout/utility/forward.hpp>
|
|
|
|
|
|
|
|
namespace sprout {
|
|
|
|
namespace random {
|
|
|
|
//
|
|
|
|
// result
|
|
|
|
//
|
|
|
|
template<typename T>
|
|
|
|
inline SPROUT_CONSTEXPR decltype(sprout::generators::generated_value(std::declval<T>()))
|
|
|
|
result(T&& t)
|
2014-08-14 13:55:49 +00:00
|
|
|
SPROUT_NOEXCEPT_IF_EXPR(sprout::generators::generated_value(std::declval<T>()))
|
2014-01-16 09:59:25 +00:00
|
|
|
{
|
2014-02-22 07:32:51 +00:00
|
|
|
return sprout::generators::generated_value(SPROUT_FORWARD(T, t));
|
2014-01-16 09:59:25 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
//
|
|
|
|
// next
|
|
|
|
//
|
|
|
|
template<typename T>
|
|
|
|
inline SPROUT_CONSTEXPR decltype(sprout::generators::next_generator(std::declval<T>()))
|
|
|
|
next(T&& t)
|
2014-08-14 13:55:49 +00:00
|
|
|
SPROUT_NOEXCEPT_IF_EXPR(sprout::generators::next_generator(std::declval<T>()))
|
2014-01-16 09:59:25 +00:00
|
|
|
{
|
2014-02-22 07:32:51 +00:00
|
|
|
return sprout::generators::next_generator(SPROUT_FORWARD(T, t));
|
2014-01-16 09:59:25 +00:00
|
|
|
}
|
|
|
|
} // namespace random
|
|
|
|
} // namespace sprout
|
|
|
|
|
2014-01-17 13:09:08 +00:00
|
|
|
#endif // #ifndef SPROUT_RANDOM_RESULTS_HPP
|