From f66ab53b9380a5367e24727df620d6620ab031f7 Mon Sep 17 00:00:00 2001 From: Bent Bisballe Nyeng Date: Mon, 2 Feb 2026 20:10:41 +0100 Subject: Apply new syntax to flags --- src/ctor.h | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) (limited to 'src/ctor.h') diff --git a/src/ctor.h b/src/ctor.h index aa46e5f..bac1e3a 100644 --- a/src/ctor.h +++ b/src/ctor.h @@ -269,6 +269,41 @@ using asm_flags = std::vector; struct flags { + template + requires (( + std::is_same_v || + std::is_same_v || + std::is_same_v || + std::is_same_v || + std::is_same_v + ) && ...) + constexpr flags(Args && ... arg) + { + ([&] + { + if constexpr(std::is_same_v) + { + cflags = arg; + } + else if constexpr(std::is_same_v) + { + cxxflags = arg; + } + else if constexpr(std::is_same_v) + { + ldflags = arg; + } + else if constexpr(std::is_same_v) + { + arflags = arg; + } + else if constexpr(std::is_same_v) + { + asmflags = arg; + } + }(), ...); + } + ctor::c_flags cflags; // flags for c compiler ctor::cxx_flags cxxflags; // flags for c++ compiler ctor::ld_flags ldflags; // flags for linker -- cgit v1.2.3