-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rename right_folds::variadic to right_folds::variadic_unrolled.
- Loading branch information
Showing
4 changed files
with
119 additions
and
91 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
98 changes: 98 additions & 0 deletions
98
include/boost/mpl11/detail/right_folds/variadic_unrolled.hpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,98 @@ | ||
/*! | ||
* @file | ||
* Defines `boost::mpl11::detail::right_folds::variadic_unrolled`. | ||
* | ||
* | ||
* @copyright Louis Dionne 2014 | ||
* Distributed under the Boost Software License, Version 1.0. | ||
* (See accompanying file LICENSE.md or copy at | ||
* http://www.boost.org/LICENSE_1_0.txt) | ||
*/ | ||
|
||
////////////////////////////////////////////////////////////////////////// | ||
// GENERATED HEADER: DO NOT EDIT. | ||
////////////////////////////////////////////////////////////////////////// | ||
|
||
#ifndef BOOST_MPL11_DETAIL_RIGHT_FOLDS_VARIADIC_UNROLLED_HPP | ||
#define BOOST_MPL11_DETAIL_RIGHT_FOLDS_VARIADIC_UNROLLED_HPP | ||
|
||
namespace boost { namespace mpl11 { namespace detail { namespace right_folds { | ||
|
||
|
||
/*! | ||
* @ingroup details | ||
* | ||
* Right fold over a parameter pack with loop unrolling. | ||
* | ||
* The metafunction is unlifted for performance. | ||
*/ | ||
template <template <typename ...> class f, typename state, typename ...xs> | ||
struct variadic_unrolled; | ||
|
||
template < | ||
template <typename ...> class f, | ||
typename state | ||
, typename x0, typename x1, typename x2, typename x3, typename x4, typename x5, | ||
typename ...xs> | ||
struct variadic_unrolled<f, state , x0, x1, x2, x3, x4, x5, xs...> | ||
: f<x0, f<x1, f<x2, f<x3, f<x4, f<x5, variadic_unrolled<f, state, xs...>>>>>>> | ||
{ }; | ||
|
||
|
||
template < | ||
template <typename ...> class f, | ||
typename state | ||
|
||
> | ||
struct variadic_unrolled<f, state > | ||
: state | ||
{ }; | ||
|
||
template < | ||
template <typename ...> class f, | ||
typename state | ||
, typename x0 | ||
> | ||
struct variadic_unrolled<f, state , x0 > | ||
: f<x0, state> | ||
{ }; | ||
|
||
template < | ||
template <typename ...> class f, | ||
typename state | ||
, typename x0, typename x1 | ||
> | ||
struct variadic_unrolled<f, state , x0, x1 > | ||
: f<x0, f<x1, state>> | ||
{ }; | ||
|
||
template < | ||
template <typename ...> class f, | ||
typename state | ||
, typename x0, typename x1, typename x2 | ||
> | ||
struct variadic_unrolled<f, state , x0, x1, x2 > | ||
: f<x0, f<x1, f<x2, state>>> | ||
{ }; | ||
|
||
template < | ||
template <typename ...> class f, | ||
typename state | ||
, typename x0, typename x1, typename x2, typename x3 | ||
> | ||
struct variadic_unrolled<f, state , x0, x1, x2, x3 > | ||
: f<x0, f<x1, f<x2, f<x3, state>>>> | ||
{ }; | ||
|
||
template < | ||
template <typename ...> class f, | ||
typename state | ||
, typename x0, typename x1, typename x2, typename x3, typename x4 | ||
> | ||
struct variadic_unrolled<f, state , x0, x1, x2, x3, x4 > | ||
: f<x0, f<x1, f<x2, f<x3, f<x4, state>>>>> | ||
{ }; | ||
|
||
}}}} // end namespace boost::mpl11::detail::right_folds | ||
|
||
#endif // !BOOST_MPL11_DETAIL_RIGHT_FOLDS_VARIADIC_UNROLLED_HPP |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters