Comments (2)
- 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.
- 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.
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)
- "ranges::to" failed for template type T with universal construction HOT 2
- warning: out-of-line definition of constexpr static data member is redundant in C++17 and is deprecated [-Wdeprecated]
- cannot create any_view from empty_view
- view chunk can't compile? HOT 1
- Cast issue with GCC12 HOT 2
- Remove duplicate elements from multiple input vectors at the same time
- views::generate doesn't work with views::chunk_by HOT 5
- ranges::to eigen HOT 2
- C++23's range_adaptor_closure equivalent HOT 2
- Security disclosure policy
- Range-v3 fails to compile on the latest MSVC version with Visual Studio 2022
- CMAKE_CXX_STANDARD 20 and RANGES_CXX_STD 17 - does not work HOT 1
- pipe adaptor support for tuple_algorithm.hpp
- Nested `key_type` for lazy set algorithms formatting?
- UB in std::views::split HOT 7
- action::remove not included
- Error when using function return value directly HOT 1
- MSVC warning C4702: unreachable code with NDEBUG
- JVM / Python / OOP like group_by view
- operator = for ranges::views::concat result HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from range-v3.