HigherOrderFunctions 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.
HigherOrderFunctions is:
constexpr initialization and constexpr evaluation of functions. It takes advantage of type deduction, variadic templates, and perfect forwarding to provide a simple and modern interface.HigherOrderFunctions is divided into three components:
Github: https://github.com/boostorg/hof/
Documentation: http://boost-hof.readthedocs.io/
This 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.
Both 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 and BOOST_HOF_STATIC_LAMBDA_FUNCTION constructs.
On 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.
Boost.HigherOrderFunctions library uses cmake to build. To configure with cmake create a build directory, and run cmake:
mkdir build
cd build
cmake ..
To install the library just run the install target:
cmake --build . --target install
The tests can be built and run by using the check target:
cmake --build . --target check
The tests can also be ran using Boost.Build, just copy library to the boost source tree, and then:
cd test
b2
The documentation is built using Sphinx. First, install the requirements needed for the documentation using pip:
pip install -r doc/requirements.txt
Then html documentation can be generated using sphinx-build:
sphinx-build -b html doc/ doc/html/
The final docs will be in the doc/html folder.
<h1>Boost.Hof <a target="_blank" href="https://travis-ci.org/boostorg/hof"><img src="https://travis-ci.org/boostorg/hof.svg?branch=master" alt="Travis status" /></a> <a target="_blank" href="https://ci.appveyor.com/project/pfultz2/hof"><img src="https://ci.appveyor.com/api/projects/status/bjj27h3v3bxbgpsp/branch/develop" alt="Appveyor status" /></a></h1> <h1>About</h1> <p>HigherOrderFunctions 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.</p> <p>HigherOrderFunctions is:</p> <ul> <li>Modern: HigherOrderFunctions takes advantages of modern C++11/C++14 features. It support both <code>constexpr</code> initialization and <code>constexpr</code> evaluation of functions. It takes advantage of type deduction, variadic templates, and perfect forwarding to provide a simple and modern interface.</li> <li>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.</li> <li>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.</li> </ul> <p>HigherOrderFunctions is divided into three components:</p> <ul> <li>Function Adaptors and Decorators: These enhance functions with additional capability.</li> <li>Functions: These return functions that achieve a specific purpose.</li> <li>Utilities: These are general utilities that are useful when defining or using functions</li> </ul> <p>Github: <a href="https://github.com/boostorg/hof/">https://github.com/boostorg/hof/</a></p> <p>Documentation: <a href="http://boost-hof.readthedocs.io/">http://boost-hof.readthedocs.io/</a></p> <h1>Motivation</h1> <ul> <li>Improve the expressiveness and capabilities of functions, including first-class citizens for function overload set, extension methods, infix operators and much more.</li> <li>Simplify constructs in C++ that have generally required metaprogramming</li> <li>Enable point-free style programming</li> <li>Workaround the limitations of lambdas in C++14</li> </ul> <h1>Requirements</h1> <p>This 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.</p> <h2>Contexpr support</h2> <p>Both 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 <a href="BOOST_HOF_STATIC_FUNCTION"><code>BOOST_HOF_STATIC_FUNCTION</code></a> and <a href="BOOST_HOF_STATIC_LAMBDA_FUNCTION"><code>BOOST_HOF_STATIC_LAMBDA_FUNCTION</code></a> constructs.</p> <h2>Noexcept support</h2> <p>On older compilers such as gcc 4.6 and gcc 4.7, <code>noexcept</code> is not used due to many bugs in the implementation. Also, most compilers don't support deducing <code>noexcept</code> with member function pointers. Only newer versions of gcc(4.9 and later) support this.</p> <h1>Building</h1> <p>Boost.HigherOrderFunctions library uses cmake to build. To configure with cmake create a build directory, and run cmake:</p> <pre class="highlightjs highlight"><code class="language- hljs">mkdir build cd build cmake .. </code></pre> <h2>Installing</h2> <p>To install the library just run the <code>install</code> target:</p> <pre class="highlightjs highlight"><code class="language- hljs">cmake --build . --target install </code></pre> <h2>Tests</h2> <p>The tests can be built and run by using the <code>check</code> target:</p> <pre class="highlightjs highlight"><code class="language- hljs">cmake --build . --target check </code></pre> <p>The tests can also be ran using Boost.Build, just copy library to the boost source tree, and then:</p> <pre class="highlightjs highlight"><code class="language- hljs">cd test b2 </code></pre> <h2>Documentation</h2> <p>The documentation is built using Sphinx. First, install the requirements needed for the documentation using <code>pip</code>:</p> <pre class="highlightjs highlight"><code class="language- hljs">pip install -r doc/requirements.txt </code></pre> <p>Then html documentation can be generated using <code>sphinx-build</code>:</p> <pre class="highlightjs highlight"><code class="language- hljs">sphinx-build -b html doc/ doc/html/ </code></pre> <p>The final docs will be in the <code>doc/html</code> folder.</p> <!-- Links -->
<h1>Boost.Hof <a target="_blank" href="https://travis-ci.org/boostorg/hof"><img src="https://travis-ci.org/boostorg/hof.svg?branch=master" alt="Travis status" /></a> <a target="_blank" href="https://ci.appveyor.com/project/pfultz2/hof"><img src="https://ci.appveyor.com/api/projects/status/bjj27h3v3bxbgpsp/branch/develop" alt="Appveyor status" /></a></h1> <h1>About</h1> <p>HigherOrderFunctions 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.</p> <p>HigherOrderFunctions is:</p> <ul> <li>Modern: HigherOrderFunctions takes advantages of modern C++11/C++14 features. It support both <code>constexpr</code> initialization and <code>constexpr</code> evaluation of functions. It takes advantage of type deduction, variadic templates, and perfect forwarding to provide a simple and modern interface.</li> <li>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.</li> <li>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.</li> </ul> <p>HigherOrderFunctions is divided into three components:</p> <ul> <li>Function Adaptors and Decorators: These enhance functions with additional capability.</li> <li>Functions: These return functions that achieve a specific purpose.</li> <li>Utilities: These are general utilities that are useful when defining or using functions</li> </ul> <p>Github: <a href="https://github.com/boostorg/hof/">https://github.com/boostorg/hof/</a></p> <p>Documentation: <a href="http://boost-hof.readthedocs.io/">http://boost-hof.readthedocs.io/</a></p> <h1>Motivation</h1> <ul> <li>Improve the expressiveness and capabilities of functions, including first-class citizens for function overload set, extension methods, infix operators and much more.</li> <li>Simplify constructs in C++ that have generally required metaprogramming</li> <li>Enable point-free style programming</li> <li>Workaround the limitations of lambdas in C++14</li> </ul> <h1>Requirements</h1> <p>This 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.</p> <h2>Contexpr support</h2> <p>Both 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 <a href="BOOST_HOF_STATIC_FUNCTION"><code>BOOST_HOF_STATIC_FUNCTION</code></a> and <a href="BOOST_HOF_STATIC_LAMBDA_FUNCTION"><code>BOOST_HOF_STATIC_LAMBDA_FUNCTION</code></a> constructs.</p> <h2>Noexcept support</h2> <p>On older compilers such as gcc 4.6 and gcc 4.7, <code>noexcept</code> is not used due to many bugs in the implementation. Also, most compilers don't support deducing <code>noexcept</code> with member function pointers. Only newer versions of gcc(4.9 and later) support this.</p> <h1>Building</h1> <p>Boost.HigherOrderFunctions library uses cmake to build. To configure with cmake create a build directory, and run cmake:</p> <pre class="highlightjs highlight"><code class="language- hljs">mkdir build cd build cmake .. </code></pre> <h2>Installing</h2> <p>To install the library just run the <code>install</code> target:</p> <pre class="highlightjs highlight"><code class="language- hljs">cmake --build . --target install </code></pre> <h2>Tests</h2> <p>The tests can be built and run by using the <code>check</code> target:</p> <pre class="highlightjs highlight"><code class="language- hljs">cmake --build . --target check </code></pre> <p>The tests can also be ran using Boost.Build, just copy library to the boost source tree, and then:</p> <pre class="highlightjs highlight"><code class="language- hljs">cd test b2 </code></pre> <h2>Documentation</h2> <p>The documentation is built using Sphinx. First, install the requirements needed for the documentation using <code>pip</code>:</p> <pre class="highlightjs highlight"><code class="language- hljs">pip install -r doc/requirements.txt </code></pre> <p>Then html documentation can be generated using <code>sphinx-build</code>:</p> <pre class="highlightjs highlight"><code class="language- hljs">sphinx-build -b html doc/ doc/html/ </code></pre> <p>The final docs will be in the <code>doc/html</code> folder.</p> <!-- Links -->