Mirror reflection library 0.5.13
|
00001 00012 #ifndef MIRROR_META_PROG_CONCAT_1011291729_HPP 00013 #define MIRROR_META_PROG_CONCAT_1011291729_HPP 00014 00015 00016 #include <mirror/meta_prog/range.hpp> 00017 00018 MIRROR_NAMESPACE_BEGIN 00019 namespace mp { 00020 00021 #ifdef MIRROR_DOCUMENTATION_ONLY 00022 00023 00029 template <class Range1, class ... Ranges> 00030 struct concat 00031 { 00032 typedef Range type; 00033 }; 00034 #endif 00035 00036 template <> 00037 struct concat<> 00038 { 00039 typedef empty_range type; 00040 }; 00041 00042 // specialization for a single range 00043 template <typename ... P> 00044 struct concat<range<P...> > 00045 { 00046 typedef range<P...> type; 00047 }; 00048 00049 // specialization for two ranges 00050 template <typename ... P1, typename ... P2> 00051 struct concat<range<P1...>, range<P2...> > 00052 { 00053 typedef range<P1..., P2...> type; 00054 }; 00055 00056 // specialization for two range expressions 00057 template <typename X1, typename X2> 00058 struct concat<X1, X2> 00059 { 00060 MIRROR_ASSERT_RETURNS_RANGE(X1); 00061 MIRROR_ASSERT_RETURNS_RANGE(X2); 00062 00063 typedef typename concat< 00064 typename X1::type, 00065 typename X2::type 00066 >::type type; 00067 }; 00068 00069 template <typename X1, typename X2, typename ... Xs> 00070 struct concat<X1, X2, Xs...> 00071 { 00072 typedef typename concat< 00073 X1, 00074 typename concat<X2, Xs...>::type 00075 >::type type; 00076 }; 00077 00078 00079 } // namespace mp 00080 MIRROR_NAMESPACE_END 00081 00082 #endif //include guard 00083