2012-10-24 11:52:09 +00:00
|
|
|
#ifndef SPROUT_UTILITY_VALUE_HOLDER_GET_HPP
|
|
|
|
#define SPROUT_UTILITY_VALUE_HOLDER_GET_HPP
|
|
|
|
|
|
|
|
#include <sprout/config.hpp>
|
|
|
|
#include <sprout/utility/value_holder/value_holder.hpp>
|
2013-06-04 14:15:05 +00:00
|
|
|
#include <sprout/utility/move.hpp>
|
2012-10-24 11:52:09 +00:00
|
|
|
|
|
|
|
namespace sprout {
|
|
|
|
//
|
|
|
|
// get
|
|
|
|
//
|
|
|
|
template<typename T>
|
2013-06-04 14:15:05 +00:00
|
|
|
inline SPROUT_CONSTEXPR typename sprout::value_holder<T>::reference_type
|
|
|
|
get(sprout::value_holder<T>& x) {
|
|
|
|
return sprout::value_holder<T>::get(x);
|
|
|
|
}
|
|
|
|
template<typename T>
|
|
|
|
inline SPROUT_CONSTEXPR typename sprout::value_holder<T>::rvalue_reference
|
|
|
|
get(sprout::value_holder<T>&& x) {
|
|
|
|
return sprout::value_holder<T>::get(sprout::move(x));
|
|
|
|
}
|
|
|
|
template<typename T>
|
2012-10-24 11:52:09 +00:00
|
|
|
inline SPROUT_CONSTEXPR typename sprout::value_holder<T>::reference_const_type
|
|
|
|
get(sprout::value_holder<T> const& x) {
|
2013-06-04 14:15:05 +00:00
|
|
|
return sprout::value_holder<T>::get(x);
|
2012-10-24 11:52:09 +00:00
|
|
|
}
|
|
|
|
template<typename T>
|
2013-06-04 14:15:05 +00:00
|
|
|
inline SPROUT_CONSTEXPR typename sprout::value_holder<T>::pointer_type
|
|
|
|
get(sprout::value_holder<T>* x) {
|
|
|
|
return sprout::value_holder<T>::get_pointer(*x);
|
2012-10-24 11:52:09 +00:00
|
|
|
}
|
|
|
|
template<typename T>
|
|
|
|
inline SPROUT_CONSTEXPR typename sprout::value_holder<T>::pointer_const_type
|
|
|
|
get(sprout::value_holder<T> const* x) {
|
2013-06-04 14:15:05 +00:00
|
|
|
return sprout::value_holder<T>::get_pointer(*x);
|
2012-10-24 11:52:09 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
//
|
|
|
|
// get_pointer
|
|
|
|
//
|
|
|
|
template<typename T>
|
2013-06-04 14:15:05 +00:00
|
|
|
inline SPROUT_CONSTEXPR typename sprout::value_holder<T>::pointer_type
|
|
|
|
get_pointer(sprout::value_holder<T>& x) {
|
|
|
|
return sprout::value_holder<T>::get_pointer(x);
|
2012-10-24 11:52:09 +00:00
|
|
|
}
|
|
|
|
template<typename T>
|
2013-06-04 14:15:05 +00:00
|
|
|
inline SPROUT_CONSTEXPR typename sprout::value_holder<T>::pointer_type
|
|
|
|
get_pointer(sprout::value_holder<T>&& x) {
|
|
|
|
return sprout::value_holder<T>::get_pointer(sprout::move(x));
|
|
|
|
}
|
|
|
|
template<typename T>
|
|
|
|
inline SPROUT_CONSTEXPR typename sprout::value_holder<T>::pointer_const_type
|
|
|
|
get_pointer(sprout::value_holder<T> const& x) {
|
|
|
|
return sprout::value_holder<T>::get_pointer(x);
|
2012-10-24 11:52:09 +00:00
|
|
|
}
|
|
|
|
} // namespace sprout
|
|
|
|
|
2013-03-22 05:24:19 +00:00
|
|
|
#endif // #ifndef SPROUT_UTILITY_VALUE_HOLDER_GET_HPP
|