1
0
Fork 0
mirror of https://github.com/bolero-MURAKAMI/Sprout synced 2025-08-03 12:49:50 +00:00

add type_traits/*

This commit is contained in:
bolero-MURAKAMI 2012-04-05 14:54:23 +09:00
parent 84956034ad
commit 64dd2582a4
13 changed files with 114 additions and 76 deletions

View file

@ -0,0 +1,20 @@
#ifndef SPROUT_UTILITY_AS_LVALUE_HPP
#define SPROUT_UTILITY_AS_LVALUE_HPP
#include <sprout/config.hpp>
namespace sprout {
//
// as_lvalue
//
template<typename T>
inline T& as_lvalue(T& t) {
return t;
}
template<typename T>
inline SPROUT_CONSTEXPR T const& as_lvalue(T const& t) {
return t;
}
} // namespace sprout
#endif // #ifndef SPROUT_UTILITY_AS_LVALUE_HPP

View file

@ -1,29 +0,0 @@
#ifndef SPROUT_UTILITY_AS_LVREF_HPP
#define SPROUT_UTILITY_AS_LVREF_HPP
#include <sprout/config.hpp>
namespace sprout {
//
// as_lvref
//
template<typename T>
inline T& as_lvref(T& t) {
return t;
}
template<typename T>
inline SPROUT_CONSTEXPR T const& as_lvref(T const& t) {
return t;
}
//
// lvref
//
template<typename T>
struct lvref {
public:
typedef decltype(sprout::as_lvref(std::declval<T&&>())) type;
};
} // namespace sprout
#endif // #ifndef SPROUT_UTILITY_AS_LVREF_HPP

View file

@ -2,7 +2,7 @@
#define SPROUT_UTILITY_OPERATION_EXT_HPP
#include <sprout/config.hpp>
#include <sprout/utility/as_lvref.hpp>
#include <sprout/utility/as_lvalue.hpp>
#include <sprout/utility/as_const.hpp>
#endif // #ifndef SPROUT_UTILITY_OPERATION_EXT_HPP