implement string class with custom behavior
- by truman
In one of our class sir said that template allows one to customize behavior of class, and then he gave example of string class, that with few lines of code we can customize string class from STL, as in, we can make it to treat 'a' and 'z' same, 'b' and 'y' same, 'c' and 'x' same and so on. Similary 'A' and 'Z' same etc.
"abc" == "zyx" is true;
"Abc" == "zyx" is false;
"Abc == "Zyx" is true;
etc
I was thinking of implementing such string class, but I am not able to do so. How can we implement such string class using templates?