Skip to content

Commit

Permalink
inherit
Browse files Browse the repository at this point in the history
  • Loading branch information
bernhardmgruber committed Oct 15, 2021
1 parent 982c25b commit 70cdd91
Showing 1 changed file with 5 additions and 36 deletions.
41 changes: 5 additions & 36 deletions include/pmacc/particles/boostExtension/InheritLinearly.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,48 +19,17 @@
* If not, see <http://www.gnu.org/licenses/>.
*/


#pragma once


#include "pmacc/meta/accessors/Identity.hpp"

#include <boost/mpl/inherit.hpp>
#include <boost/mpl/inherit_linearly.hpp>
#include <boost/mpl/placeholders.hpp>
#include "pmacc/types.hpp"

namespace pmacc
{
namespace detail
{
/** get combined type which inherit from a boost mpl sequence
*
* @tparam T_Sequence boost mpl sequence with classes
* @tparam T_Accessor unary operator to transform each element of the sequence
*/
template<typename T_Sequence, template<typename> class T_Accessor = meta::accessors::Identity>
using InheritLinearly =
typename boost::mpl::inherit_linearly<T_Sequence, boost::mpl::inherit<boost::mpl::_1, T_Accessor<boost::mpl::_2>>>::type;

} // namespace detail
template<typename T_Sequence, template<typename> typename T_Accessor = bmp::mp_identity_t>
struct InheritLinearly;

/** type which inherits from multiple classes
*
* @tparam T_Sequence boost mpl sequence with classes
* @tparam T_Accessor unary operator to transform each element of the sequence
*/
template<typename T_Sequence, template<typename> class T_Accessor = meta::accessors::Identity>
struct InheritLinearly : detail::InheritLinearly<T_Sequence, T_Accessor>
template<typename... Ts, template<typename> typename T_Accessor>
struct InheritLinearly<bmp::mp_list<Ts...>, T_Accessor> : T_Accessor<Ts>...
{
};


// template<typename T_Sequence, template<typename> class T_Accessor = meta::accessors::Identity>
// struct InheritLinearly;

// template<typename... Pairs, template<typename> class T_Accessor>
// struct InheritLinearly<bmp::mp_list<Pairs...>, T_Accessor> : T_Accessor<Pairs>...
//{
//};

} // namespace pmacc

0 comments on commit 70cdd91

Please sign in to comment.