From 17e0c75d30cc402a4623758faa820652ed8ca764 Mon Sep 17 00:00:00 2001 From: jvoisin Date: Thu, 13 May 2021 16:18:28 +0200 Subject: [PATCH] Some more constexpr in esm/variant.cpp --- components/esm/variant.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/components/esm/variant.cpp b/components/esm/variant.cpp index 3e0417ef72..830e13f3e4 100644 --- a/components/esm/variant.cpp +++ b/components/esm/variant.cpp @@ -10,20 +10,20 @@ namespace { - const uint32_t STRV = ESM::FourCC<'S','T','R','V'>::value; - const uint32_t INTV = ESM::FourCC<'I','N','T','V'>::value; - const uint32_t FLTV = ESM::FourCC<'F','L','T','V'>::value; - const uint32_t STTV = ESM::FourCC<'S','T','T','V'>::value; + constexpr uint32_t STRV = ESM::FourCC<'S','T','R','V'>::value; + constexpr uint32_t INTV = ESM::FourCC<'I','N','T','V'>::value; + constexpr uint32_t FLTV = ESM::FourCC<'F','L','T','V'>::value; + constexpr uint32_t STTV = ESM::FourCC<'S','T','T','V'>::value; template struct GetValue { - T operator()(int value) const { return static_cast(value); } + constexpr T operator()(int value) const { return static_cast(value); } - T operator()(float value) const { return static_cast(value); } + constexpr T operator()(float value) const { return static_cast(value); } template - T operator()(const V&) const + constexpr T operator()(const V&) const { if constexpr (orDefault) return T {};