Giter Club home page Giter Club logo

Comments (2)

asutton avatar asutton commented on May 20, 2024
  1. Should ranges::sort default to requiring TotallyOrdered? ranges::less
    may be less (ha ha) surprising to users. (In my case I can and will just
    define operator== etc, but I can imagine there may be cases where that is
    not desirable.)

What cases? Are they imaginary or do you have examples that serve a
practical purpose?

Please do not try to drive algorithm requirements based on imaginary use
cases.

  1. Is it necessary for less to require the presence of operators >, <=,
    and >=? I understand that all of these operators should be defined if any
    are, but it still feels surprising that less is not callable on a type
    that defines operator<. (At least when we do get concepts the error
    messages will finally be understandable)

These are both reasonable requirements. Those algorithms are derived from
the concept of a total order (or in some case a weak order) and their
associated operations.

For example, if you can call less(), surely you can call greater() -- after
all, if something is not less, then it may be greater, right? And of course
greater() is defined using >.

Oops, now rule_t works with less() but not greater(). This also means that
you can't sort() in descending order.

I know that greater() is not defined in this library, but it is defined by
the standard, and it's defined to use >.

Andrew

from range-v3.

cordarei avatar cordarei commented on May 20, 2024

What cases? Are they imaginary or do you have examples that serve a
practical purpose?

No, I don't have an example; I was simply speculating. Sorry for the noise.

from range-v3.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.