1<!-- Copyright 2018 Paul Fultz II 2 Distributed under the Boost Software License, Version 1.0. 3 (http://www.boost.org/LICENSE_1_0.txt) 4--> 5 6About 7===== 8 9HigherOrderFunctions is a header-only C++11/C++14 library that provides utilities for functions and function objects, which can solve many problems with much simpler constructs than whats traditionally been done with metaprogramming. 10 11HigherOrderFunctions is: 12 13- Modern: HigherOrderFunctions takes advantages of modern C++11/C++14 features. It support both `constexpr` initialization and `constexpr` evaluation of functions. It takes advantage of type deduction, varidiac templates, and perfect forwarding to provide a simple and modern interface. 14- Relevant: HigherOrderFunctions provides utilities for functions and does not try to implement a functional language in C++. As such, HigherOrderFunctions solves many problems relevant to C++ programmers, including initialization of function objects and lambdas, overloading with ordering, improved return type deduction, and much more. 15- Lightweight: HigherOrderFunctions builds simple lightweight abstraction on top of function objects. It does not require subscribing to an entire framework. Just use the parts you need. 16 17HigherOrderFunctions is divided into three components: 18 19* Function Adaptors and Decorators: These enhance functions with additional capability. 20* Functions: These return functions that achieve a specific purpose. 21* Utilities: These are general utilities that are useful when defining or using functions 22 23Github: [https://github.com/pfultz2/higherorderfunctions/](https://github.com/pfultz2/higherorderfunctions/) 24 25Documentation: [http://pfultz2.github.io/higherorderfunctions/doc/html/](http://pfultz2.github.io/higherorderfunctions/doc/html/) 26 27Motivation 28========== 29 30- Improve the expressiveness and capabilities of functions, including first-class citzens for function overload set, extension methods, infix operators and much more. 31- Simplify constructs in C++ that have generally required metaprogramming 32- Enable point-free style programming 33- Workaround the limitations of lambdas in C++14 34 35Requirements 36============ 37 38This requires a C++11 compiler. There are no third-party dependencies. This has been tested on clang 3.5-3.8, gcc 4.6-7, and Visual Studio 2015 and 2017. 39 40Contexpr support 41---------------- 42 43Both MSVC and gcc 4.6 have limited constexpr support due to many bugs in the implementation of constexpr. However, constexpr initialization of functions is supported when using the [`BOOST_HOF_STATIC_FUNCTION`](BOOST_HOF_STATIC_FUNCTION) and [`BOOST_HOF_STATIC_LAMBDA_FUNCTION`](BOOST_HOF_STATIC_LAMBDA_FUNCTION) constructs. 44 45Noexcept support 46---------------- 47 48On older compilers such as gcc 4.6 and gcc 4.7, `noexcept` is not used due to many bugs in the implementation. Also, most compilers don't support deducing `noexcept` with member function pointers. Only newer versions of gcc(4.9 and later) support this. 49