14#include "comms/details/tag.h"
23COMMS_GNU_WARNING_DISABLE(
"-Wtype-limits")
34template <std::u
intmax_t TFrom, std::u
intmax_t TUntil,
typename TBase>
37 using BaseImpl = TBase;
38 static_assert(TFrom <= TUntil,
"Invalid parameters");
41 using ValueType =
typename BaseImpl::ValueType;
52 : BaseImpl(
std::move(val))
61 static constexpr bool isVersionDependent()
66 bool setVersion(VersionType version)
68 bool updated = BaseImpl::setVersion(version);
70 if (aboveFrom(version) && belowUntil(version)) {
74 if (mode == BaseImpl::getMode()) {
78 BaseImpl::setMode(mode);
83 template <
typename... TParams>
84 using AlwaysTrueTag = comms::details::tag::Tag1<>;
85 template <
typename... TParams>
86 using CompareTag = comms::details::tag::Tag2<>;
88 static bool aboveFrom(VersionType version)
91 typename comms::util::LazyShallowConditional<
97 return aboveFrom(version, Tag());
100 template <
typename... TParams>
101 static constexpr bool aboveFrom(VersionType, AlwaysTrueTag<TParams...>)
106 template <
typename... TParams>
107 static bool aboveFrom(VersionType version, CompareTag<TParams...>)
112 static_cast<decltype(TFrom)
>(std::numeric_limits<VersionType>::max()),
118 static bool belowUntil(VersionType version)
121 typename comms::util::LazyShallowConditional<
122 static_cast<decltype(TUntil)
>(std::numeric_limits<VersionType>::max()) <= TUntil
127 return belowUntil(version, Tag());
130 template <
typename... TParams>
131 static constexpr bool belowUntil(VersionType, AlwaysTrueTag<TParams...>)
136 template <
typename... TParams>
137 static bool belowUntil(VersionType version, CompareTag<TParams...>)
142 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:1930
comms::option::def::ExistsBetweenVersions< TFrom, TUntil > ExistsBetweenVersions
Same as comms::option::def::ExistsBetweenVersions.
Definition options.h:1939
Main namespace for all classes / functions of COMMS library.
constexpr unsigned version()
Version of the COMMS library as single numeric value.
Definition version.h:66
Replacement to some types from standard type_traits.