Mirror reflection library 0.5.13
|
00001 00012 #ifndef MIRROR_META_PROG_TRANSFORM_1011291729_HPP 00013 #define MIRROR_META_PROG_TRANSFORM_1011291729_HPP 00014 00015 00016 #include <mirror/meta_prog/range.hpp> 00017 #include <mirror/meta_prog/traits.hpp> 00018 #include <mirror/meta_prog/lambda.hpp> 00019 00020 MIRROR_NAMESPACE_BEGIN 00021 namespace mp { 00022 00023 #ifdef MIRROR_DOCUMENTATION_ONLY 00024 00025 00031 template <class Range, class UnaryMetaFnClass> 00032 struct transform 00033 { 00034 typedef Range type; 00035 }; 00036 #endif 00037 00038 template <typename ... P, class UnaryMetaFnClass> 00039 struct transform<range<P...>, UnaryMetaFnClass> 00040 { 00041 typedef range< 00042 typename apply<UnaryMetaFnClass, P>::type ... 00043 > type; 00044 }; 00045 00046 // specialization for range expressions 00047 template <typename X, class Predicate> 00048 struct transform 00049 { 00050 MIRROR_ASSERT_RETURNS_RANGE(X); 00051 typedef typename transform<typename X::type, Predicate>::type type; 00052 }; 00053 00054 } // namespace mp 00055 MIRROR_NAMESPACE_END 00056 00057 #endif //include guard 00058