Comments (5)
D style ranges can be used to iterate over things like std::tuple or other sequences that have varying types.
They might offer the same API for heterogeneous containers as for homogeneous run-time containers (like Fusion/STL), but is the algorithm implementation the same for heterogeneous sequences and run-time sequences?
These can't be implemented using C++ iterators without losing type information.
IIRC Boost.Fusion has "iterators" (besides "ranges") that do work on heterogeneous sequences. They are just a different type of iterators (and "ranges"). From an API pov, they work very similarly tho, and one can map knowledge from Boost.Range to Boost.Fusion and viceversa (which i think is the important thing).
Offering the same API for "everything" is appealing, and Boost.Hana actually does that, it works on type-only (mpl::vector), heterogeneous (std::tuple), and homogeneous (std::vector) sequences. However, even tho it could be possible to efficiently handle homogeneous run-time sequences in Hana, I believe one would have to specialize its algorithms for these sequences. The API could be the same, but the implementation would be very different, so one ends up with one API, but internally two different library implementations (just like Fusion/STL). Note that this is directly opposed to how Hana algorithms work on both type-only and heterogeneous sequences.
from range-v3.
D style ranges can be used to iterate over things like std::tuple or other sequences that have varying types.
They can? Where does it say that? What is the return type of the range's front
property? It can't change type dynamically, can it?
from range-v3.
But wouldn't the D range have a
==
that would satisfy this requirements? Or perhaps have afront_equal
andback_equal
, since a D range can refer to two positions?
You can test if two D ranges are equal, but that's not a positional comparison. It tests the values of the elements. What I said is true: D ranges are not positional.
from range-v3.
Closing this, unless you have something else to say on the matter, @pfultz2.
from range-v3.
Sorry for the late reply.
They can? Where does it say that? What is the return type of the range's front property? It can't change type dynamically, can it?
I assume every time you call pop
it returns a new range, so for each range front
can return a different type, but I am not entirely familiar with D.
from range-v3.
Related Issues (20)
- 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 HOT 2
- 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
- Is there an approach to concat 2 vector? HOT 2
- ranges::views::chunk_by and std::views::chunk_by return different results HOT 1
- ranges::transform cannot be compiled with c++17
- With compiling with gcc >= 11.1 for C++20, constraint depending on itself when checking for member begin on constant ref_view around boost range
- Why isn't repeat_n a range adaptor?
- Implementation Request for ranges::views::pairwise and ranges::views::adjacent
- Make range-v3 a Bazel module (Support Bzlmod) 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.