This is the mail archive of the
libstdc++@gcc.gnu.org
mailing list for the libstdc++ project.
Re: Remove algo duplication
- From: Marc Glisse <marc dot glisse at inria dot fr>
- To: Paolo Carlini <paolo dot carlini at oracle dot com>
- Cc: libstdc++ at gcc dot gnu dot org, Christopher Jefferson <chris at bubblescope dot net>, François Dumont <frs dot dumont at gmail dot com>
- Date: Mon, 16 Sep 2013 16:54:34 +0200 (CEST)
- Subject: Re: Remove algo duplication
- Authentication-results: sourceware.org; auth=none
- References: <52264074 dot 2050502 at gmail dot com> <alpine dot DEB dot 2 dot 10 dot 1309081625460 dot 3536 at laptop-mg dot saclay dot inria dot fr> <522E246F dot 5040608 at gmail dot com> <E2836BBC-F90D-4AE5-AAAB-EB3242BF030D at oracle dot com> <CA+jCFLtpCASpP1NTru=__hOQo5O-uj0m82YDqmB2wBYxspcQxA at mail dot gmail dot com> <alpine dot DEB dot 2 dot 10 dot 1309151125180 dot 3593 at laptop-mg dot saclay dot inria dot fr> <CA+jCFLsgUS3x0AVQDvn1OUgkYt6EJJojUrL4xrtVo9XQwq8J6A at mail dot gmail dot com> <alpine dot DEB dot 2 dot 10 dot 1309161348100 dot 3698 at laptop-mg dot saclay dot inria dot fr> <523706CD dot 5060707 at oracle dot com>
- Reply-to: libstdc++ at gcc dot gnu dot org
On Mon, 16 Sep 2013, Paolo Carlini wrote:
Testcases? If we have solutions which would not get right some concrete
cases, we should really have testcases for those, in my opinion. Then we
should double check the standard about those, how much is QoI and how much
just plain conformance. Does C++11 eventually spell out more details about
proxy iterators? I think at some point it was a goal, but I'm not sure how
much went into the actual Standard. In principle we could even envisage two
different forwarding strategies, one for C++98, pretty good, not perfect, but
well within C++98 conformance. A better one for C++11, which would be able to
exploit the whole move semantics, "perfect" forwarding support we have got in
the language. The hope is that the whole predefined_ops.h would be anyway
decently compact and understandable.
I think having the simple lexicographical_compare forward to the predicate
version with std::less<void>() is valid. All I am saying is that I'll be
able to tell the difference if we do it, but that's just because some copy
elision won't happen (in a contrived testcase), and compilers were never
forced to do copy elision, so that's ok. It should even work in C++03 with
an emulation of less<void> using 16 overloads (T cv1&, U cv2&).
By the way, I thought someone had contributed less<void> and the others
already, but I can't see them. Did I imagine that patch?
--
Marc Glisse