(please find a more complete example here Compiler Explorer … it’s not very creative, it counts the number of lines in for_each.hpp by determining the lengths of all lines in the file and then ignore the results and report how many lines were counted)
I suspect it’s something around the construct for_each( getlines | other_view, … ) because as you can see in the comment, for_each(getlines, … ) is accepted. (This also means I have a workaround by just pushing all pipe logic into the lambda).
From the error it’s not entirely clear to me what goes wrong and if my code shouldn’t compile or if the error is on the side of range v3 or nvc++, but i thought i should let you know.
I talked with one of our C++ engineers and he believes nvc++ should be giving an error as “requires_” is being declared as a variable rather than a function. Though, he’s not confident in the answer nor can easily explain why g++ accepts it, but unfortunately doesn’t does have the time right now to dig into it.