C++ LINQ-like iterator operations

后端 未结 8 988
执念已碎
执念已碎 2021-02-13 13:40

Having been tainted by Linq, I\'m reluctant to give it up. However, for some things I just need to use C++.

The real strength of linq as a linq-consumer (i.e. to me) li

8条回答
  •  日久生厌
    2021-02-13 14:06

    See this Google Groups thread.

    vector numbers = {1, 2, 3, 4, 8, 5, 9 , 24, 19, 15, 12 } 
    auto query = 
        from(numbers).
            where([](int i) { return i < 15 && i > 10}). 
            select(fields::full_object); 
    

    I couldn't find anything more or less "official" or widely accepted, but you can try contacting the author of the original post.

提交回复
热议问题