cpp: set of structs

if we have to declare a set of user defined structs, then we need to overload the
namespace my_space {

typedef struct _struct {
std::string key;

friend bool operator return a.key.compare(b.key) }
} my_struct;

int main() {

std::set my_set_of_structs;

}

} // namespace my_space

thanks Tom Gunn.

Blog at WordPress.com.

Up ↑