14 inline bool rcmp(
const char* a_1,
const char* a_2) {
15 size_t l1 = ::strlen(a_1);
16 size_t l2 = ::strlen(a_2);
17 if(l1!=l2)
return false;
19 const char* p1 = a_1+l1-1;
20 const char* p2 = a_2+l2-1;
23 for(
size_t index=0;index<l1;index++,p1--,p2--) {
24 if(*p1!=*p2)
return false;
29 inline bool rcmp(
const std::string& a_1,
const char* a_2) {
30 std::string::size_type l1 = a_1.size();
31 size_t l2 = ::strlen(a_2);
32 if(
size_t(l1)!=l2)
return false;
34 const char* p1 = a_1.c_str()+l1-1;
35 const char* p2 = a_2+l2-1;
38 for(std::string::size_type index=0;index<l1;index++,p1--,p2--) {
39 if(*p1!=*p2)
return false;
44 inline bool rcmp(
const char* a_1,
const std::string& a_2) {
45 size_t l1 = ::strlen(a_1);
46 std::string::size_type l2 = a_2.size();
47 if(l1!=
size_t(l2))
return false;
49 const char* p1 = a_1+l1-1;
50 const char* p2 = a_2.c_str()+l2-1;
53 for(
size_t index=0;index<l1;index++,p1--,p2--) {
54 if(*p1!=*p2)
return false;
59 inline bool rcmp(
const std::string& a_1,
const std::string& a_2) {
60 std::string::size_type l1 = a_1.size();
61 std::string::size_type l2 = a_2.size();
62 if(l1!=l2)
return false;
64 const char* p1 = a_1.c_str()+l1-1;
65 const char* p2 = a_2.c_str()+l2-1;
68 for(std::string::size_type index=0;index<l1;index++,p1--,p2--) {
69 if(*p1!=*p2)
return false;