Q. What is the purpose of making an comparator "transparent"?
A. The associative container lookup functions (find, lower_bound,
upper_bound, equal_range) only take an argument of key_type, requiring
users to construct (either implicitly or explicitly) an object of the
key_type to do the lookup. This may be expensive, e.g. constructing a
large object to search in a set when the comparator function only
looks at one field of the object. There is strong desire among users
to be able to search using other types which are comparable with the
key_type.
Q. What problem does this solve
A. The LWG had concerns about code like the following:
std::set<std::string> s = /* ... */;
s.find("key");
In C++11 this will construct a single std::string temporary and then
compare it with elements to find the key.
With the change proposed by N3465 the std::set::find() function would
be an unconstrained template which would pass the const char* through
to the comparator function, std::less, which would
construct a std::string temporary for every comparison. The LWG
considered this performance problem to be a serious issue. The
template find() function would also prevent finding NULL in a
container of pointers, which causes previously valid code to no longer
compile, but this was seen as a less serious issue than the silent
performance regression
Q. does this change how standard containers work
A. This proposal modifies the associative containers in and
by overloading the lookup member functions with member function
templates. There are no language changes.
Q. so does the default set lose its find, count, etc. members
A. Almost all existing C++11 code is unaffected because the member
functions are not present unless new C++14 library features are used
as the comparison functions.