Skip to content

Latest commit

 

History

History
24 lines (20 loc) · 571 Bytes

README.md

File metadata and controls

24 lines (20 loc) · 571 Bytes

eXstream

C++ 14 library that provides functional-style stream operations under collections.

Example

struct Person
{
    std::string name;
    std::set<int> marks;
};

std::vector<Person> persons = { ... };

stream_of(persons)
    .flat_map([](auto person) { return std::ref(person.marks); })
    .filter  ([](auto mark)   { return mark > 0; })
    .distinct()
    .collect(to_set());
    
stream_of(persons)
    .map   ([](auto person) { return std::ref(person.name); })
    .filter([](auto name)   { return name != "Mike"s; })
    .collect(to_list());