From ddd67b79f3331d47fd9fec10c1de14612cad4738 Mon Sep 17 00:00:00 2001 From: lisyarus Date: Sat, 21 May 2022 19:51:43 +0300 Subject: [PATCH] Support creating util::flag_set directly from representation type --- libs/util/include/psemek/util/flag_set.hpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/libs/util/include/psemek/util/flag_set.hpp b/libs/util/include/psemek/util/flag_set.hpp index 51a99259..36b45e78 100644 --- a/libs/util/include/psemek/util/flag_set.hpp +++ b/libs/util/include/psemek/util/flag_set.hpp @@ -19,7 +19,11 @@ namespace psemek::util flag_set(flag_set const &) = default; - template + flag_set(Repr const & repr) + : value(repr) + {} + + template && ...), void>> flag_set(Flags const & ... flags) : value{((1 << static_cast(flags)) | ...)} {}