/*============================================================================= Copyright (c) 2011-2013 Bolero MURAKAMI 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) =============================================================================*/ #ifndef SPROUT_OPTIONAL_GET_HPP #define SPROUT_OPTIONAL_GET_HPP #include #include namespace sprout { // // get // template inline SPROUT_CONSTEXPR typename sprout::optional::reference_type get(sprout::optional& x) { return sprout::optional::get(x); } template inline SPROUT_CONSTEXPR typename sprout::optional::rvalue_reference_type get(sprout::optional&& x) { return sprout::optional::get(sprout::move(x)); } template inline SPROUT_CONSTEXPR typename sprout::optional::reference_const_type get(sprout::optional const& x) { return sprout::optional::get(x); } template inline SPROUT_CONSTEXPR typename sprout::optional::pointer_type get(sprout::optional* x) { return sprout::optional::get_pointer(*x); } template inline SPROUT_CONSTEXPR typename sprout::optional::pointer_const_type get(sprout::optional const* x) { return sprout::optional::get_pointer(*x); } // // get_pointer // template inline SPROUT_CONSTEXPR typename sprout::optional::pointer_type get_pointer(sprout::optional& x) { return sprout::optional::get_pointer(x); } template inline SPROUT_CONSTEXPR typename sprout::optional::pointer_type get_pointer(sprout::optional&& x) { return sprout::optional::get_pointer(sprout::move(x)); } template inline SPROUT_CONSTEXPR typename sprout::optional::pointer_const_type get_pointer(sprout::optional const& x) { return sprout::optional::get_pointer(x); } // // get_value_or // template inline SPROUT_CONSTEXPR typename sprout::optional::reference_type get_value_or(sprout::optional& x, typename sprout::optional::reference_type v) { return sprout::optional::get_value_or(x, v); } template inline SPROUT_CONSTEXPR typename sprout::optional::rvalue_reference_type get_value_or(sprout::optional&& x, typename sprout::optional::rvalue_reference_type v) { return sprout::optional::get_value_or(sprout::move(x), static_cast::rvalue_reference_type>(v)); } template inline SPROUT_CONSTEXPR typename sprout::optional::reference_const_type get_value_or(sprout::optional const& x, typename sprout::optional::reference_const_type v) { return sprout::optional::get_value_or(x, v); } } // namespace sprout #endif // #ifndef SPROUT_OPTIONAL_GET_HPP