18#include "comms/details/tag.h"
21COMMS_GNU_WARNING_DISABLE(
"-Wtype-limits")
32template <std::u
intmax_t TFrom, std::u
intmax_t TUntil,
typename TBase>
35 using BaseImpl = TBase;
36 static_assert(TFrom <= TUntil,
"Invalid parameters");
39 using ValueType =
typename BaseImpl::ValueType;
50 : BaseImpl(
std::move(val))
59 static constexpr bool isVersionDependent()
64 bool setVersion(VersionType version)
66 bool updated = BaseImpl::setVersion(version);
68 if (aboveFrom(version) && belowUntil(version)) {
72 if (mode == BaseImpl::getMode()) {
76 BaseImpl::setMode(mode);
81 template <
typename... TParams>
82 using AlwaysTrueTag = comms::details::tag::Tag1<>;
83 template <
typename... TParams>
84 using CompareTag = comms::details::tag::Tag2<>;
86 static bool aboveFrom(VersionType version)
89 typename comms::util::LazyShallowConditional<
95 return aboveFrom(version, Tag());
98 template <
typename... TParams>
99 static constexpr bool aboveFrom(VersionType, AlwaysTrueTag<TParams...>)
104 template <
typename... TParams>
105 static bool aboveFrom(VersionType version, CompareTag<TParams...>)
110 static_cast<decltype(TFrom)
>(std::numeric_limits<VersionType>::max()),
116 static bool belowUntil(VersionType version)
119 typename comms::util::LazyShallowConditional<
120 static_cast<decltype(TUntil)
>(std::numeric_limits<VersionType>::max()) <= TUntil
125 return belowUntil(version, Tag());
128 template <
typename... TParams>
129 static constexpr bool belowUntil(VersionType, AlwaysTrueTag<TParams...>)
134 template <
typename... TParams>
135 static bool belowUntil(VersionType version, CompareTag<TParams...>)
140 static_cast<decltype(TUntil)
>(std::numeric_limits<VersionType>::max()),
This file contains classes required for generic custom assertion functionality.
Contains various compiler related definitions.
Contains definition of the mode used for comms::field::Optional fields.
@ Exists
Field must exist.
@ Missing
Field doesn't exist.
comms::option::def::VersionType< T > VersionType
Same as comms::option::def::VersionType.
Definition options.h:1797
comms::option::def::ExistsBetweenVersions< TFrom, TUntil > ExistsBetweenVersions
Same as comms::option::def::ExistsBetweenVersions.
Definition options.h:1804
Main namespace for all classes / functions of COMMS library.
constexpr unsigned version()
Version of the COMMS library as single numeric value.
Definition version.h:64
Replacement to some types from standard type_traits.