FTL is a C++17-based library that provides a more convenient API for collections processing. The API is heavily inspired by the Rust programming language.
Collection processing with FTL is very easy. Below you can find a simple example presenting the power of the FTL.
structTree { enum Kind { Oak, Acer, Pine, Other };
int height;
int diameter;
Kind kind;
intvolume() const;
};
ftl::vector<Tree> cityTrees{...};
int oakVolSum = 0;
// Old-school stylefor (constauto& tree: cityTrees) {
if (tree.kind == Tree::Oak) {
if (tree.diameter > 25) oakVolSum += tree.volume();
}
}
// FTL styleconstauto totalVolume = cityTrees.iter()
.filter([](constauto &tree) { return tree.kind == Tree::Oak && tree.diameter > 25; })
.map([](constauto &tree) { return tree.volume(); })
.sum();- A C++ compiler that supports C++17
- CMake 3.17+
- Conan
- Doxygen
- ccache
- clang-tidy
- Cppcheck
- include-what-you-use
Contributions are very welcome! Either by reporting issues or submitting pull requests.
FTL is licensed under the terms of the Boost Software Licence 1.0 - see LICENSE