--
You received this message because you are subscribed to the Google Groups "cxx" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cxx+uns...@chromium.org.
To post to this group, send email to c...@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/cxx/CAD649j5b0rzTATUOhGb3dWLYqmbxEoX0_r0%3DndV7ZaRruh5E0g%40mail.gmail.com.
Since std::tie uses tuples, allowing it in general is probably blocked on coming up with a plan for base::Tuple vs std::tuple – filed http://crbug.com/554987 for that. (Also, using it for `a, b = c, d` style assignments looks kind of weird to me.)
Allowing it just for implementing operator< sounds like a fine plan in the meantime to me, since getting operator< wrong is surprisingly common.
--On Wed, Nov 11, 2015 at 3:44 PM, Joshua Bell <jsb...@chromium.org> wrote:--std::tie (from <tuple>) allows unpacking std::tuple members. While we don't use std::tuple yet (we have base::Tuple; perhaps that should be a prerequisite?), there's a useful idiom for multi-member comparisons:bool Foo::operator<(const Foo& rhs) const {return std:tie(a_, b_, c_) < std::tie(rhs.a_, rhs.b_, rhs.c_);}Sample CL: https://codereview.chromium.org/1438073002/
You received this message because you are subscribed to the Google Groups "cxx" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cxx+uns...@chromium.org.
To post to this group, send email to c...@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/cxx/CAD649j5b0rzTATUOhGb3dWLYqmbxEoX0_r0%3DndV7ZaRruh5E0g%40mail.gmail.com.
You received this message because you are subscribed to the Google Groups "cxx" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cxx+uns...@chromium.org.
To post to this group, send email to c...@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/cxx/CAMGbLiF81jx0ViXJRHtnRhvYk1n%3DgF2zyu3-WC1VHY-5fcKUDw%40mail.gmail.com.
On Thu, Nov 12, 2015 at 10:09 AM, Nico Weber <tha...@chromium.org> wrote:Since std::tie uses tuples, allowing it in general is probably blocked on coming up with a plan for base::Tuple vs std::tuple – filed http://crbug.com/554987 for that. (Also, using it for `a, b = c, d` style assignments looks kind of weird to me.)(a, b = c, d looks like a weird way to get around "one statement per line" more-or-less, but maybe makes more sense with functions returning tuples.)
--Allowing it just for implementing operator< sounds like a fine plan in the meantime to me, since getting operator< wrong is surprisingly common.+1To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/cxx/CAMGbLiF81jx0ViXJRHtnRhvYk1n%3DgF2zyu3-WC1VHY-5fcKUDw%40mail.gmail.com.--On Wed, Nov 11, 2015 at 3:44 PM, Joshua Bell <jsb...@chromium.org> wrote:--std::tie (from <tuple>) allows unpacking std::tuple members. While we don't use std::tuple yet (we have base::Tuple; perhaps that should be a prerequisite?), there's a useful idiom for multi-member comparisons:bool Foo::operator<(const Foo& rhs) const {return std:tie(a_, b_, c_) < std::tie(rhs.a_, rhs.b_, rhs.c_);}Sample CL: https://codereview.chromium.org/1438073002/
You received this message because you are subscribed to the Google Groups "cxx" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cxx+uns...@chromium.org.
To post to this group, send email to c...@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/cxx/CAD649j5b0rzTATUOhGb3dWLYqmbxEoX0_r0%3DndV7ZaRruh5E0g%40mail.gmail.com.
You received this message because you are subscribed to the Google Groups "cxx" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cxx+uns...@chromium.org.
To post to this group, send email to c...@chromium.org.
You received this message because you are subscribed to the Google Groups "cxx" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cxx+uns...@chromium.org.
To post to this group, send email to c...@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/cxx/CAHtyhaTJOx%3DofnrPJUZwUYuWudWgFKgovbJwkfUyUR4O8jz3dA%40mail.gmail.com.