1
0
Fork 0
mirror of https://github.com/bolero-MURAKAMI/Sprout synced 2024-11-12 21:09:01 +00:00
Sprout/sprout/optional/make_optional.hpp
2012-10-22 23:10:11 +09:00

23 lines
563 B
C++

#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