Belle II Software development
IsDetected.h
1/**************************************************************************
2 * basf2 (Belle II Analysis Software Framework) *
3 * Author: The Belle II Collaboration *
4 * *
5 * See git log for contributors and copyright holders. *
6 * This file is licensed under LGPL-3.0, see LICENSE.md. *
7 **************************************************************************/
8#pragma once
9
10#include <type_traits>
11
12namespace Belle2 {
17 namespace TrackFindingCDC {
18
20 template<typename... Ts>
21 using ToVoid = void;
22
24 template<typename, template<typename...> class, typename...>
25 struct DetectPropertyImpl : std::false_type {};
26
28 template<template<class...> class AToPredicate, typename... Ts>
29 struct DetectPropertyImpl<ToVoid<AToPredicate<Ts...>>, AToPredicate, Ts...> : std::true_type {};
30
40 template<template<class...> class AToPredicate, typename... Ts>
41 constexpr bool isDetected()
42 {
43 return DetectPropertyImpl<ToVoid<>, AToPredicate, Ts...>::value;
44 }
45 }
47}
Abstract base class for different kinds of events.
Implementation of the detection idiom - base case is not detected.
Definition: IsDetected.h:25