Added useful concepts

This commit is contained in:
matthias@arch 2022-11-01 18:17:43 +01:00
parent b2e6958bb4
commit 7e7e46c7d4

22
src/concepts.hpp Normal file
View File

@ -0,0 +1,22 @@
#pragma once
#include <concepts>
#include <ranges>
namespace gz::util {
/// Satisfied when T is in PackTypes
template<typename T, typename... PackTypes>
concept IsInPack = (std::same_as<T, PackTypes> || ...);
template<typename T>
concept False = false;
/// Forward range holding integers
template<typename T>
concept IntegralForwardRange = std::ranges::forward_range<T> and std::integral<std::ranges::range_value_t<T>>;
}
/**
* @file
* @brief Concepts that might be useful elsewhere
*/