From f6fb251d9800a1a778f0863b72479646bdc8d439 Mon Sep 17 00:00:00 2001 From: 0xFEEDC0DE64 Date: Fri, 29 Jan 2021 15:54:18 +0100 Subject: [PATCH] Added is_in --- esputils.h | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/esputils.h b/esputils.h index ab97b49..0517768 100644 --- a/esputils.h +++ b/esputils.h @@ -220,5 +220,12 @@ struct EspOverload : EspConstOverload, EspNonConstOverload template constexpr __attribute__((__unused__)) EspOverload espOverload = {}; template constexpr __attribute__((__unused__)) EspConstOverload espConstOverload = {}; template constexpr __attribute__((__unused__)) EspNonConstOverload espNonConstOverload = {}; + +template +bool is_in(First &&first, T && ... t) +{ + return ((first == t) || ...); +} + } // namespace } // namespace espcpputils