This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug libstdc++/15910] can't compile self defined void distance(std::vector<T>, std::vector<T>)


------- Additional Comments From giovannibajo at libero dot it  2004-08-03 13:21 -------
Subject: Re:  can't compile self defined void distance(std::vector<T>, std::vector<T>)

bangerth at dealii dot org wrote:

> However,
> I don't know whether the standard allows us to actually check these
> requirements on template arguments in a way that not only rejects a
> program in which they are not satisfied, but rather
> _reject a given function from the overload set_ and allows us to pick
> a different function.

You do realize that this happens only because ::distance() is defined with name
"distance", has 2 parameters, and it is called with (at least) one argument
from namespace std, right? Do you really believe it makes sense to reject this
very special situation and allow any other orthogonally similar use of such a
function?

W are also allowed to define std::distance with a different prototype under the
as-if rule if we want to, and I think this improves the C++ experience for the
user, that is, we have a better compiler if we do.

I can agree (as I said) that we are not literally *forced* to do it, but not
that it would not be better doing it. This is why I haven't changed back
'enhancement' to 'rejects-valid'. Note that I still personally think it is
valid code, though.

Giovanni Bajo




-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=15910


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]