z*y 发帖数: 1311 | 1 Suppose to design a List template...
Then need "List::find(T d)", e.g. if the list has an element of "d" return
true.
Then the comparison of whether two elements are equal really depends on type
T. so what will be the way to do this?
Thank you for your suggestion. |
b********n 发帖数: 609 | 2 完全看class T的operator == 怎么写的呀,和你有什么关系。
type
【在 z*y 的大作中提到】 : Suppose to design a List template... : Then need "List::find(T d)", e.g. if the list has an element of "d" return : true. : Then the comparison of whether two elements are equal really depends on type : T. so what will be the way to do this? : Thank you for your suggestion.
|
a****l 发帖数: 8211 | 3 "Equal" means "A>B" is false and "B>A" is false.
type
【在 z*y 的大作中提到】 : Suppose to design a List template... : Then need "List::find(T d)", e.g. if the list has an element of "d" return : true. : Then the comparison of whether two elements are equal really depends on type : T. so what will be the way to do this? : Thank you for your suggestion.
|