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

add Sprout.Weed ->* Attribute-conversion

This commit is contained in:
bolero-MURAKAMI 2012-05-31 22:28:58 +09:00
parent fa3851227e
commit 3a968fa5ac
35 changed files with 369 additions and 112 deletions

View file

@ -135,7 +135,7 @@ namespace sprout {
typedef typename sprout::weed::attr_cnv::result_of::bitwise_or<T, U>::type type;
return sprout::make<type>();
}
// unused >> unused -> unused
// unused | unused -> unused
template<typename T, typename U, typename X>
inline SPROUT_CONSTEXPR typename std::enable_if<
sprout::weed::detail::is_both_unused<T, U>::value,

View file

@ -0,0 +1,22 @@
#ifndef SPROUT_WEED_ATTR_CNV_MEM_PTR_HPP
#define SPROUT_WEED_ATTR_CNV_MEM_PTR_HPP
#include <sprout/config.hpp>
#include <sprout/weed/attr_cnv/result_of/mem_ptr.hpp>
namespace sprout {
namespace weed {
namespace attr_cnv {
//
// mem_ptr
//
template<typename T, typename U>
inline SPROUT_CONSTEXPR typename sprout::weed::attr_cnv::result_of::mem_ptr<T, U>::type
mem_ptr(T const& t, U const& u) {
return u(t);
}
} // namespace attr_cnv
} // namespace weed
} // namespace sprout
#endif // #ifndef SPROUT_WEED_ATTR_CNV_MEM_PTR_HPP

View file

@ -7,5 +7,6 @@
#include <sprout/weed/attr_cnv/result_of/shift_left.hpp>
#include <sprout/weed/attr_cnv/result_of/modulus.hpp>
#include <sprout/weed/attr_cnv/result_of/bitwise_or.hpp>
#include <sprout/weed/attr_cnv/result_of/mem_ptr.hpp>
#endif // #ifndef SPROUT_WEED_ATTR_CNV_RESULT_OF_HPP

View file

@ -0,0 +1,23 @@
#ifndef SPROUT_WEED_ATTR_CNV_RESULT_OF_MEM_PTR_HPP
#define SPROUT_WEED_ATTR_CNV_RESULT_OF_MEM_PTR_HPP
#include <type_traits>
#include <sprout/config.hpp>
namespace sprout {
namespace weed {
namespace attr_cnv {
namespace result_of {
//
// mem_ptr
//
template<typename T, typename U, typename = void>
struct mem_ptr
: public std::result_of<U(T)>
{};
} // namespace result_of
} // namespace attr_cnv
} // namespace weed
} // namespace sprout
#endif // #ifndef SPROUT_WEED_ATTR_CNV_RESULT_OF_MEM_PTR_HPP