Descrption
Implement a template function cmp which compares any type of two elements.Makes it suitable to compare any two int, double, float, char, string and any two same type of pointers.*If the first parameter is equal to the second one, then return true, elsewise, false.
You can be careful that:
(1)When comparing two int, double, float, char*, string , you should compare their values.
(2)When comparing two pointers, you should compare the values they point to.
(3)the cmp function should always return a boolean value.
题目描述:
请实现一个模板函数cmp,它可以比较多种元素类型,包括int、double、float、char、string和任意两个相同类型的指针。
如果第一个参数等于第二个参数,则返回true, 否则返回 false。
注意