Jonathan Poelen b21ff00f9b optimize mp_transform_if (extract f from the struct to benefit from memoization)
compiler |       gcc-12      |      clang-15
before   | 0:00.13s - 60432K | 0:00.16s - 100956K
after    | 0:00.11s - 47300K | 0:00.16s - 100484K

```cpp
using namespace boost::mp11;

template<class T> using p = mp_bool<T::value & 1>;
template<class T> using f = mp_size_t<T::value + 1>;
template<class I> using test = mp_transform_if<p, f, mp_iota<I>>;

using r1 = mp_transform<test, mp_iota_c<50>>;
```
2025-11-09 20:33:36 +01:00
2025-11-01 14:12:53 +02:00
2020-06-11 16:40:34 +03:00
2015-06-21 19:51:06 +03:00
2021-06-13 01:16:58 +03:00
2024-04-18 11:31:22 +03:00
2024-08-27 14:44:26 +03:00
2025-10-09 18:32:10 +03:00
2017-08-04 02:32:23 +03:00
2023-05-14 06:58:48 +03:00

Mp11, a C++11 metaprogramming library

Mp11 is a C++11 metaprogramming library based on template aliases and variadic templates. It implements the approach outlined in the article "Simple C++11 metaprogramming" and its sequel.

Mp11 is part of Boost, starting with release 1.66.0. It however has no Boost dependencies and can be used standalone, as a Git submodule, for instance. For CMake users, add_subdirectory is supported, as is installation and find_package(boost_mp11).

Supported compilers

  • g++ 4.8 or later
  • clang++ 3.9 or later
  • Visual Studio 2013 or later

Tested on Github Actions and Appveyor.

License

Distributed under the Boost Software License, Version 1.0.

S
Description
C++11 metaprogramming library
Readme 2.2 MiB
Languages
C++ 99.1%
CMake 0.5%
Python 0.1%
Shell 0.1%
Batchfile 0.1%