2013-08-08 18:54:33 +09:00
|
|
|
/*=============================================================================
|
2016-02-25 18:48:28 +09:00
|
|
|
Copyright (c) 2011-2016 Bolero MURAKAMI
|
2013-08-08 18:54:33 +09: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)
|
|
|
|
=============================================================================*/
|
2011-11-12 20:24:42 +09:00
|
|
|
#ifndef SPROUT_VARIANT_APPLY_VISITOR_HPP
|
|
|
|
#define SPROUT_VARIANT_APPLY_VISITOR_HPP
|
|
|
|
|
2012-12-19 23:06:08 +09:00
|
|
|
#include <type_traits>
|
2011-11-12 20:24:42 +09:00
|
|
|
#include <sprout/config.hpp>
|
|
|
|
#include <sprout/utility/forward.hpp>
|
2012-12-20 00:09:05 +09:00
|
|
|
#include <sprout/variant/visitor_result.hpp>
|
2011-11-12 20:24:42 +09:00
|
|
|
|
|
|
|
namespace sprout {
|
2012-12-19 23:06:08 +09:00
|
|
|
//
|
|
|
|
// apply_visitor
|
|
|
|
//
|
2011-11-12 20:24:42 +09:00
|
|
|
template<typename Visitor, typename Visitable>
|
2012-12-19 23:06:08 +09:00
|
|
|
inline SPROUT_CONSTEXPR typename sprout::visitor_result<
|
|
|
|
typename std::remove_reference<Visitor>::type,
|
|
|
|
typename std::remove_reference<Visitable>::type
|
|
|
|
>::type
|
2012-10-06 00:58:56 +09:00
|
|
|
apply_visitor(Visitor&& visitor, Visitable&& visitable) {
|
2014-02-22 16:32:51 +09:00
|
|
|
return SPROUT_FORWARD(Visitable, visitable).apply_visitor(SPROUT_FORWARD(Visitor, visitor));
|
2011-11-12 20:24:42 +09:00
|
|
|
}
|
|
|
|
} // namespace sprout
|
|
|
|
|
|
|
|
#endif // #ifndef SPROUT_VARIANT_APPLY_VISITOR_HPP
|