Changeset 3a49185 in Lumiera
- Timestamp:
-
2026-05-14T14:32:54Z
(5 weeks ago)
- Author:
- Ichthyostega <prg@…>
- Branches:
- dev/play, documentation, integration
- Children:
- 7448b81
- Parents:
- d94bfe6
- git-author:
- Ichthyostega <prg@…> (13/05/26 21:44:48)
- git-committer:
- Ichthyostega <prg@…> (14/05/26 14:32:54)
- Message:
-
Library: introduce a concept for the »Lumiera Forward Iterator«
Well, finally.
Lumiera Iterators were conceived as a concept from the very beginning,
and this idea dates back even before C++11. Furthermore, over time some
trait templates have been developed, to detect if some template argument
might match the known pattern of functions associated with a Lumiera Iterator.
Meanwhile this concept is used pervasively in the whole code base, and also
the traits templates proved to be reliable. It therefore seems that the time is ripe
to gradually introduce a genuine concept lum_iter
I'll take a defensive approach here, since any mistake would lead to
a massive breakage of compilation. The new concept is defined simply
by delegating to to the tried-and-tested trait template, which is
also renamed can_IterForEach ⟼ can_LumieraIter
One immediate benefit is that the compiler is now able to select
overloads based on that concept, which allows to drop the tricky
selection of variants based on the SFINAE technique and enable_if.
For validation, one very heavily used case of that pattern was switched
in lib/format-util.hpp', which notably lies in the code-path used by util::join`
-
(No files)
-