Mirror reflection library 0.5.13
|
00001 00011 #ifndef MIRROR_META_PROG_FIND_1011291729_HPP 00012 #define MIRROR_META_PROG_FIND_1011291729_HPP 00013 00014 00015 #include <mirror/meta_prog/range.hpp> 00016 #include <mirror/meta_prog/traits.hpp> 00017 00018 MIRROR_NAMESPACE_BEGIN 00019 namespace mp { 00020 00021 #ifdef MIRROR_DOCUMENTATION_ONLY 00022 00023 00029 template <typename Range, typename Type> 00030 struct find 00031 { 00032 typedef Range type; 00033 }; 00034 #endif 00035 00036 // specialization of find for other expressions 00037 template <typename X, typename T> 00038 struct find 00039 { 00040 MIRROR_ASSERT_RETURNS_RANGE(X); 00041 typedef typename find<typename X::type, T>::type type; 00042 }; 00043 00044 // specialization of find for empty ranges 00045 template <typename T> 00046 struct find<range<>, T> 00047 { 00048 typedef range<> type; 00049 }; 00050 00051 // specialization of find for ranges starting with the type searched for 00052 template <typename ... P, typename T> 00053 struct find<range<T, P...>, T> 00054 { 00055 typedef range<T, P...> type; 00056 }; 00057 00058 // specialization of find for ranges not starting with the type searched for 00059 template <typename H, typename ... P, typename T> 00060 struct find<range<H, P...>, T> 00061 { 00062 typedef typename find<range<P...>, T>::type type; 00063 }; 00064 00065 00066 } // namespace mp 00067 MIRROR_NAMESPACE_END 00068 00069 #endif //include guard 00070