1 Feb 2001 03:07
Re: Koenig lookup, names in std:: - Summary
Dietmar Kuehl <dietmar_kuehl <at> yahoo.com>
2001-02-01 02:07:07 GMT
2001-02-01 02:07:07 GMT
Matthew Austern wrote: > I don't really see this as more than half a solution, because standard > library implementors can't use it without a whole lot of changes in the > library portions of the C++ standard. You certainly couldn't use > swap_t when writing std::sort(), or abs_t when writing std::valarray(). Why would an algorithm want to use 'swap_t'? 'swap_t' is only used for two purposes: - To implement 'swap()'. - To allow users partial specialization of 'swap()', although somewhat indirectly. Of course, a library implementation conforming to the current standard would call 'swap_t' something like '_Swap_t' to stay in the correct namespace but other than that I don't see any reason not to use 'swap_t' for the implementation of 'swap()' and documenting this fact: It would be a conforming extension to allow users [partial] specialization of '_Swap_t'. If this approach is mandated by the next revision of the standard, the names would change but this should not be a problem because the next standard will [hopefully] allow template typedef's, too![]()
RSS Feed