Skip to content

Commit 48e03b3

Browse files
committed
Attempt to support MSVC2026 compilation.
1 parent b0ab8a0 commit 48e03b3

2 files changed

Lines changed: 21 additions & 21 deletions

File tree

include/comms/field/basic/Variant.h

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -182,12 +182,12 @@ class VariantExecHelper
182182
template <std::size_t TIdx, typename TField>
183183
void operator()()
184184
{
185-
#if COMMS_IS_MSVC
185+
#if COMMS_IS_MSVC_2025_OR_BELOW
186186
// VS compiler
187187
m_func.operator()<TIdx>(*(reinterpret_cast<TField*>(m_storage)));
188-
#else // #if COMMS_IS_MSVC
188+
#else // #if COMMS_IS_MSVC_2025_OR_BELOW
189189
m_func.template operator()<TIdx>(*(reinterpret_cast<TField*>(m_storage)));
190-
#endif // #if COMMS_IS_MSVC
190+
#endif // #if COMMS_IS_MSVC_2025_OR_BELOW
191191
}
192192
private:
193193
void* m_storage = nullptr;
@@ -206,12 +206,12 @@ class VariantConstExecHelper
206206
template <std::size_t TIdx, typename TField>
207207
void operator()()
208208
{
209-
#if COMMS_IS_MSVC
209+
#if COMMS_IS_MSVC_2025_OR_BELOW
210210
// VS compiler
211211
m_func.operator()<TIdx>(*(reinterpret_cast<const TField*>(m_storage)));
212-
#else // #if COMMS_IS_MSVC
212+
#else // #if COMMS_IS_MSVC_2025_OR_BELOW
213213
m_func.template operator()<TIdx>(*(reinterpret_cast<const TField*>(m_storage)));
214-
#endif // #if COMMS_IS_MSVC
214+
#endif // #if COMMS_IS_MSVC_2025_OR_BELOW
215215
}
216216
private:
217217
const void* m_storage = nullptr;

include/comms/util/Tuple.h

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -350,12 +350,12 @@ struct TupleForEachTypeHelper
350350
static constexpr bool NextHasElems = (NextRem != 0U);
351351

352352
using ElemType = typename std::tuple_element<Idx, Tuple>::type;
353-
#if COMMS_IS_MSVC
353+
#if COMMS_IS_MSVC_2025_OR_BELOW
354354
// VS compiler
355355
func.operator()<ElemType>();
356-
#else // #if COMMS_IS_MSVC
356+
#else // #if COMMS_IS_MSVC_2025_OR_BELOW
357357
func.template operator()<ElemType>();
358-
#endif // #if COMMS_IS_MSVC
358+
#endif // #if COMMS_IS_MSVC_2025_OR_BELOW
359359
TupleForEachTypeHelper<NextHasElems>::template exec<NextRem, TTuple>(
360360
std::forward<TFunc>(func));
361361
}
@@ -477,12 +477,12 @@ struct TupleForEachWithTemplateParamIdxHelper
477477
static constexpr std::size_t NextRem = TRem - 1;
478478
static constexpr bool NextHasElems = (NextRem != 0U);
479479

480-
#if COMMS_IS_MSVC
480+
#if COMMS_IS_MSVC_2025_OR_BELOW
481481
// VS compiler
482482
func.operator()<Idx>(std::get<Idx>(std::forward<TTuple>(tuple)));
483-
#else // #if COMMS_IS_MSVC
483+
#else // #if COMMS_IS_MSVC_2025_OR_BELOW
484484
func.template operator()<Idx>(std::get<Idx>(std::forward<TTuple>(tuple)));
485-
#endif // #if COMMS_IS_MSVC
485+
#endif // #if COMMS_IS_MSVC_2025_OR_BELOW
486486
TupleForEachWithTemplateParamIdxHelper<NextHasElems>::template exec<NextRem>(
487487
std::forward<TTuple>(tuple),
488488
std::forward<TFunc>(func));
@@ -643,11 +643,11 @@ class TupleTypeAccumulateHelper
643643
static_assert((TOff + TRem) <= std::tuple_size<Tuple>::value, "Incorrect TRem");
644644

645645
return TupleTypeAccumulateHelper<(1U < TRem)>::template exec<TOff + 1, TRem - 1, Tuple>(
646-
#if COMMS_IS_MSVC
646+
#if COMMS_IS_MSVC_2025_OR_BELOW
647647
func.operator()
648-
#else // #if COMMS_IS_MSVC
648+
#else // #if COMMS_IS_MSVC_2025_OR_BELOW
649649
func.template operator()
650-
#endif // #if COMMS_IS_MSVC
650+
#endif // #if COMMS_IS_MSVC_2025_OR_BELOW
651651
<typename std::tuple_element<TOff, Tuple>::type>(value),
652652
std::forward<TFunc>(func));
653653
}
@@ -763,12 +763,12 @@ struct TupleSelectedTypeHelper<false>
763763
static_cast<void>(idx);
764764
COMMS_ASSERT(idx == TFromIdx);
765765
using ElemType = typename std::tuple_element<TFromIdx, TTuple>::type;
766-
#if COMMS_IS_MSVC
766+
#if COMMS_IS_MSVC_2025_OR_BELOW
767767
// VS compiler
768768
func.operator()<TFromIdx, ElemType>();
769-
#else // #if COMMS_IS_MSVC
769+
#else // #if COMMS_IS_MSVC_2025_OR_BELOW
770770
func.template operator()<TFromIdx, ElemType>();
771-
#endif // #if COMMS_IS_MSVC
771+
#endif // #if COMMS_IS_MSVC_2025_OR_BELOW
772772
}
773773
};
774774

@@ -948,12 +948,12 @@ class TupleTypeIsAnyOfHelper
948948
static_assert(TRem <= std::tuple_size<Tuple>::value, "Incorrect TRem");
949949
using ElemType = typename std::tuple_element<std::tuple_size<Tuple>::value - TRem, Tuple>::type;
950950
return
951-
#if COMMS_IS_MSVC
951+
#if COMMS_IS_MSVC_2025_OR_BELOW
952952
// VS compiler
953953
func.operator()<ElemType>() ||
954-
#else // #if COMMS_IS_MSVC
954+
#else // #if COMMS_IS_MSVC_2025_OR_BELOW
955955
func.template operator()<ElemType>() ||
956-
#endif // #if COMMS_IS_MSVC
956+
#endif // #if COMMS_IS_MSVC_2025_OR_BELOW
957957
TupleTypeIsAnyOfHelper<1U < TRem>::template check<TRem - 1, TTuple>(
958958
std::forward<TFunc>(func));
959959
}

0 commit comments

Comments
 (0)