------- Additional Comments From adah at netstd dot com 2005-08-12 10:50 ------- (In reply to comment #97) > Subject: Re: can't compile self defined void distance(std::vector<T>, std::vector<T>) > "adah at netstd dot com" <[EMAIL PROTECTED]> writes: > | > you still fail to provide such a definition for "interface". > | > -- Gaby > | > | Why should I? > Because, it is *you* who brought that topic in this discussion. > | Herb defined it in Exceptional C++, Item 32: > | > | For a class X, all functions, including free functions, that both > | > | * `mention' X > | * are `supplied with' X > | > | are logically part of X, because they form part of the interface of X. > That definition bans std::swap as currently usable > with std::complex<double>, e.g. > std::complex<double> w, z; > swap(z, w);
Herb's opinion is that one should write `std::swap(...)'. `Swap' is just an algorithm, and has nothing to do with `complex' per se. It is clearly stated in Section 4.3 of his proposal. > You would have hard-time convincing me that I want that behaviour for > standard C++, let alone GCC. Furtheremo more, you have to define > "supplied with". If N gives me > namespace N { > struct X { }; > } > and M adds > namespace M { > using N::X; > f(X); > } > is M::f part of N::X's interface? I guess `No'. Herb's rationale is in C++ Coding Standards: 57. Keep a type and its nonmember function interface in the same namespace. Please differentiate between what I request and what we discuss. I did not advocate to implement Herb's proposal here. At least not yet. Best regards, Yongwei -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=15910