Mirror reflection library 0.5.13
|
00001 00010 #ifndef MIRROR_CT_STRING_FIND_1105240825_HPP 00011 #define MIRROR_CT_STRING_FIND_1105240825_HPP 00012 00013 #include <mirror/ct_string/default.hpp> 00014 #include <mirror/ct_string/starts_with.hpp> 00015 #include <mirror/ct_string/empty.hpp> 00016 #include <type_traits> 00017 00018 MIRROR_NAMESPACE_BEGIN 00019 namespace cts { 00020 namespace aux { 00021 00022 template < 00023 typename Temp, 00024 typename Searched, 00025 typename Found, 00026 typename Failed 00027 > struct find_hlp; 00028 00029 template <typename Char> 00030 struct find_hlp< 00031 basic_string<Char>, 00032 basic_string<Char>, 00033 std::true_type, 00034 std::true_type 00035 > 00036 { 00037 typedef basic_string<Char> type; 00038 }; 00039 00040 template < 00041 typename Char, 00042 Char ... CTn, 00043 Char ... CSn 00044 > struct find_hlp< 00045 basic_string<Char, CTn...>, 00046 basic_string<Char, CSn...>, 00047 std::true_type, 00048 std::false_type 00049 > 00050 { 00051 typedef basic_string<Char, CTn...> type; 00052 }; 00053 00054 template < 00055 typename Char, 00056 Char ... CTn, 00057 Char ... CSn 00058 > struct find_hlp< 00059 basic_string<Char, CTn...>, 00060 basic_string<Char, CSn...>, 00061 std::false_type, 00062 std::true_type 00063 > 00064 { 00065 typedef basic_string<Char> type; 00066 }; 00067 00068 template < 00069 typename Char, 00070 Char CT, 00071 Char ... CTn, 00072 Char ... CSn 00073 > struct find_hlp< 00074 basic_string<Char, CT, CTn...>, 00075 basic_string<Char, CSn...>, 00076 std::false_type, 00077 std::false_type 00078 > : find_hlp< 00079 basic_string<Char, CTn...>, 00080 basic_string<Char, CSn...>, 00081 typename starts_with< 00082 basic_string<Char, CTn...>, 00083 basic_string<Char, CSn...> 00084 >::type, 00085 typename empty<basic_string<Char, CTn...> >::type 00086 > 00087 { }; 00088 00089 } // namespace aux 00090 00091 template <typename Char, Char ... C1n, Char ... C2n> 00092 struct find< 00093 basic_string<Char, C1n...>, 00094 basic_string<Char, C2n...> 00095 > : aux::find_hlp< 00096 basic_string<Char, C1n...>, 00097 basic_string<Char, C2n...>, 00098 typename starts_with< 00099 basic_string<Char, C1n...>, 00100 basic_string<Char, C2n...> 00101 >::type, 00102 typename empty<basic_string<Char, C1n...> >::type 00103 > { }; 00104 00105 } // namespace cts 00106 MIRROR_NAMESPACE_END 00107 00108 #endif //include guard 00109