LeechCraft  0.6.70-15082-g543737046d
Modular cross-platform feature rich live environment.
typelevel.h
Go to the documentation of this file.
1 /**********************************************************************
2  * LeechCraft - modular cross-platform feature rich internet client.
3  * Copyright (C) 2006-2014 Georg Rudoy
4  *
5  * Distributed under the Boost Software License, Version 1.0.
6  * (See accompanying file LICENSE or copy at https://www.boost.org/LICENSE_1_0.txt)
7  **********************************************************************/
8 
9 #pragma once
10 
11 #include <type_traits>
12 
13 namespace LC
14 {
15 namespace Util
16 {
17  template<template<typename> class Pred>
18  struct Not
19  {
20  template<typename V>
21  struct Negate;
22 
23  template<bool V>
24  struct Negate<std::integral_constant<bool, V>>
25  {
26  using Result_t = std::integral_constant<bool, !V>;
27  };
28 
29  template<typename T>
30  struct Result_t : Negate<typename Pred<T>::type>::Result_t {};
31  };
32 
33  template<template<typename> class Pred, typename... Args>
34  constexpr auto AllOf = (Pred<Args> {} && ...);
35 
36  template<template<typename> class Pred, typename... Args>
37  constexpr auto AnyOf = (Pred<Args> {} || ...);
38 }
39 }
LC::Util::AnyOf
constexpr auto AnyOf
Definition: typelevel.h:49
LC::Util::Not::Result_t
Definition: typelevel.h:48
LC::Util::Not::Negate
Definition: typelevel.h:39
LC
Definition: constants.h:14
LC::Util::AllOf
constexpr auto AllOf
Definition: typelevel.h:46