2013-08-08 09:54:33 +00:00
|
|
|
/*=============================================================================
|
2015-01-10 10:13:57 +00:00
|
|
|
Copyright (c) 2011-2015 Bolero MURAKAMI
|
2013-08-08 09:54:33 +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)
|
|
|
|
=============================================================================*/
|
2011-11-06 01:56:57 +00:00
|
|
|
#ifndef SPROUT_VARIANT_GET_HPP
|
|
|
|
#define SPROUT_VARIANT_GET_HPP
|
|
|
|
|
|
|
|
#include <sprout/config.hpp>
|
2014-04-30 07:30:26 +00:00
|
|
|
#include <sprout/workaround/std/cstddef.hpp>
|
2012-09-29 09:41:13 +00:00
|
|
|
#include <sprout/tuple/tuple/get.hpp>
|
2011-11-06 01:56:57 +00:00
|
|
|
#include <sprout/variant/variant.hpp>
|
|
|
|
|
|
|
|
namespace sprout {
|
|
|
|
//
|
|
|
|
// get
|
|
|
|
//
|
2013-11-20 13:04:11 +00:00
|
|
|
template<typename T, typename... Types>
|
|
|
|
inline SPROUT_CONSTEXPR T const&
|
2012-10-04 16:53:39 +00:00
|
|
|
get(sprout::variant<Types...> const& operand) {
|
2013-11-20 13:04:11 +00:00
|
|
|
return operand.template get<T>();
|
2011-11-06 01:56:57 +00:00
|
|
|
}
|
2013-11-20 13:04:11 +00:00
|
|
|
template<typename T, typename... Types>
|
|
|
|
inline SPROUT_CONSTEXPR T&
|
2012-10-04 16:53:39 +00:00
|
|
|
get(sprout::variant<Types...>& operand) {
|
2013-11-20 13:04:11 +00:00
|
|
|
return operand.template get<T>();
|
2011-11-06 01:56:57 +00:00
|
|
|
}
|
2012-09-29 09:41:13 +00:00
|
|
|
} // namespace sprout
|
|
|
|
|
2011-11-06 01:56:57 +00:00
|
|
|
#endif // #ifndef SPROUT_VARIANT_GET_HPP
|