[ 
https://issues.apache.org/jira/browse/MINIFICPP-1289?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17386163#comment-17386163
 ] 

Marton Szasz edited comment on MINIFICPP-1289 at 7/30/21, 9:31 AM:
-------------------------------------------------------------------

I forgot to reply to this, but I guess better late than never. The error 
message is about the lambda type not satisfying the Sentinel concept. -Actions 
can't be used with the | operator-. Try 
ranges::actions::sort(matched_files_with_mtime, first_by_mtime_then_by_name);.

The Sentinel concept is a generalization of end Iterators where the start and 
the end don't need to be of the same type, they only need to be comparable with 
!=. This allows using iterator-like constructs for things of unknown bound, 
like a null-terminated string or even an infinite range. Ranges are now defined 
by an iterator (begin) and sentinel (end) pair. Read more: 
[https://www.foonathan.net/2020/03/iterator-sentinel/]

Now that the language upgrade is near the finishing line, I would say wait 
until it's in and go for the latest range-v3. We can't go directly for 
std::ranges, because it's not yet implemented in libstdc++ 8.x or AppleClang's 
libc++, and we still need to support the former to keep compatibility with 
debian buster.


was (Author: szaszm):
I forgot to reply to this, but I guess better late than never. The error 
message is about the lambda type not satisfying the Sentinel concept. Actions 
can't be used with the | operator. Try 
ranges::actions::sort(matched_files_with_mtime, first_by_mtime_then_by_name);.

The Sentinel concept is a generalization of end Iterators where the start and 
the end don't need to be of the same type, they only need to be comparable with 
!=. This allows using iterator-like constructs for things of unknown bound, 
like a null-terminated string or even an infinite range. Ranges are now defined 
by an iterator (begin) and sentinel (end) pair. Read more: 
[https://www.foonathan.net/2020/03/iterator-sentinel/]

Now that the language upgrade is near the finishing line, I would say wait 
until it's in and go for the latest range-v3. We can't go directly for 
std::ranges, because it's not yet implemented in libstdc++ 8.x or AppleClang's 
libc++, and we still need to support the former to keep compatibility with 
debian buster.

> Add range-v3
> ------------
>
>                 Key: MINIFICPP-1289
>                 URL: https://issues.apache.org/jira/browse/MINIFICPP-1289
>             Project: Apache NiFi MiNiFi C++
>          Issue Type: Improvement
>            Reporter: Marton Szasz
>            Assignee: Marton Szasz
>            Priority: Minor
>              Labels: MiNiFi-CPP-Hygiene
>          Time Spent: 10m
>  Remaining Estimate: 0h
>
> Useful library to raise the level of abstraction from iterators to ranges and 
> provide useful related concepts.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to