Skip to content

Repository files navigation

ftl

codecovBuild StatusCMake

Overview

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.

Basic usage

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();

Dependencies

  • A C++ compiler that supports C++17
  • CMake 3.17+
  • Conan

Optional Dependencies

  • Doxygen
  • ccache
  • clang-tidy
  • Cppcheck
  • include-what-you-use

Contributing

Contributions are very welcome! Either by reporting issues or submitting pull requests.

License and Attribution

FTL is licensed under the terms of the Boost Software Licence 1.0 - see LICENSE

About

Functional Template Library for Modern C++

Topics

Resources

Stars

44 stars

Watchers

8 watching

Forks

Releases

Packages

Contributors

Languages