DebugServer2
Loading...
Searching...
No Matches
MPL.h
1//
2// Copyright (c) 2014-present, Facebook, Inc.
3// All rights reserved.
4//
5// This source code is licensed under the University of Illinois/NCSA Open
6// Source License found in the LICENSE file in the root directory of this
7// source tree. An additional grant of patent rights can be found in the
8// PATENTS file in the same directory.
9//
10
11#pragma once
12
13#include <utility>
14
15namespace ds2 {
16namespace Utils {
17
18template <typename Base, template <typename> class... Mixins> class MixinApply;
19
20template <typename Base> class MixinApply<Base> : public Base {
21public:
22 template <typename... Args>
23 explicit MixinApply(Args &&... args) : Base(std::forward<Args>(args)...) {}
24};
25
26template <typename Base, template <typename> class MixinHead,
27 template <typename> class... MixinTail>
28class MixinApply<Base, MixinHead, MixinTail...>
29 : public MixinHead<MixinApply<Base, MixinTail...>> {
30public:
31 template <typename... Args>
32 explicit MixinApply(Args &&... args)
33 : MixinHead<MixinApply<Base, MixinTail...>>(std::forward<Args>(args)...) {
34 }
35};
36} // namespace Utils
37} // namespace ds2
Definition MPL.h:18