Sprout/sprout/optional/make_optional.hpp

24 lines
563 B
C++
Raw Normal View History

2012-10-22 14:10:11 +00:00
#ifndef SPROUT_OPTIONAL_MAKE_OPTIONAL_HPP
#define SPROUT_OPTIONAL_MAKE_OPTIONAL_HPP
#include <sprout/config.hpp>
#include <sprout/optional/optional.hpp>
namespace sprout {
//
// make_optional
//
template<typename T>
inline SPROUT_CONSTEXPR sprout::optional<T>
make_optional(T const& v) {
return optional<T>(v);
}
template<typename T>
inline SPROUT_CONSTEXPR sprout::optional<T>
make_optional(bool cond, T const& v) {
return optional<T>(cond, v);
}
} // namespace sprout
#endif // #ifndef SPROUT_OPTIONAL_MAKE_OPTIONAL_HPP