#ifndef SPROUT_GENERATOR_GENERATED_VALUE_HPP #define SPROUT_GENERATOR_GENERATED_VALUE_HPP #include #include #include #include #include #include namespace sprout_adl { sprout::not_found_via_adl get_generated_value(...); } // namespace sprout_adl namespace sprout_generator_detail { using sprout_adl::get_generated_value; template inline SPROUT_CONSTEXPR decltype(sprout::generators::generator_access_traits::get_generated_value(std::declval())) get_generated_value(Gen& gen) SPROUT_NOEXCEPT_EXPR(SPROUT_NOEXCEPT_EXPR(sprout::generators::generator_access_traits::get_generated_value(std::declval()))) { return sprout::generators::generator_access_traits::get_generated_value(gen); } template inline SPROUT_CONSTEXPR typename std::enable_if< !std::is_const::value && !std::is_volatile::value && !std::is_reference::value, decltype(sprout::generators::generator_access_traits::type>::get_generated_value(std::declval())) >::type get_generated_value(Gen&& gen) SPROUT_NOEXCEPT_EXPR(SPROUT_NOEXCEPT_EXPR(sprout::generators::generator_access_traits::type>::get_generated_value(std::declval()))) { return sprout::generators::generator_access_traits::get_generated_value(gen); } template inline SPROUT_CONSTEXPR decltype(sprout::generators::generator_access_traits::get_generated_value(std::declval())) get_generated_value(Gen const& gen) SPROUT_NOEXCEPT_EXPR(SPROUT_NOEXCEPT_EXPR(sprout::generators::generator_access_traits::get_generated_value(std::declval()))) { return sprout::generators::generator_access_traits::get_generated_value(gen); } template inline SPROUT_CONSTEXPR decltype(get_generated_value(std::declval())) call_get_generated_value(Gen& gen) SPROUT_NOEXCEPT_EXPR(SPROUT_NOEXCEPT_EXPR(get_generated_value(std::declval()))) { return get_generated_value(gen); } template inline SPROUT_CONSTEXPR typename std::enable_if< !std::is_const::value && !std::is_volatile::value && !std::is_reference::value, decltype(get_generated_value(std::declval())) >::type call_get_generated_value(Gen&& gen) SPROUT_NOEXCEPT_EXPR(SPROUT_NOEXCEPT_EXPR(get_generated_value(std::declval()))) { return get_generated_value(gen); } template inline SPROUT_CONSTEXPR decltype(get_generated_value(std::declval())) call_get_generated_value(Gen const& gen) SPROUT_NOEXCEPT_EXPR(SPROUT_NOEXCEPT_EXPR(get_generated_value(std::declval()))) { return get_generated_value(gen); } } // namespace sprout_generator_detail namespace sprout { namespace generators { // // generated_value // // effect: // ADL callable get_generated_value(t) -> get_generated_value(t) // otherwise -> sprout::generators::generator_access_traits::get_generated_value(t) // [default] // member callable t.generated_value() -> t.generated_value() // otherwise -> sprout::tuples::get<0>(t) // template inline SPROUT_CONSTEXPR decltype(sprout_generator_detail::call_get_generated_value(std::declval())) generated_value(T&& t) SPROUT_NOEXCEPT_EXPR(SPROUT_NOEXCEPT_EXPR(sprout_generator_detail::call_get_generated_value(std::declval()))) { return sprout_generator_detail::call_get_generated_value(sprout::forward(t)); } } // namespace generators using sprout::generators::generated_value; } // namespace sprout #endif // #ifndef SPROUT_GENERATOR_GENERATED_VALUE_HPP