12#include "comms/details/tag.h"
22COMMS_GNU_WARNING_DISABLE(
"-Wtype-limits")
33template <std::u
intmax_t TFrom, std::u
intmax_t TUntil,
typename TBase>
36 using BaseImpl = TBase;
37 static_assert(TFrom <= TUntil,
"Invalid parameters");
40 using ValueType =
typename BaseImpl::ValueType;
51 : BaseImpl(
std::move(val))
60 static constexpr bool isVersionDependent()
65 bool setVersion(VersionType version)
67 bool updated = BaseImpl::setVersion(version);
69 if (aboveFrom(version) && belowUntil(version)) {
73 if (mode == BaseImpl::getMode()) {
77 BaseImpl::setMode(mode);
82 template <
typename... TParams>
83 using AlwaysTrueTag = comms::details::tag::Tag1<>;
84 template <
typename... TParams>
85 using CompareTag = comms::details::tag::Tag2<>;
87 static bool aboveFrom(VersionType version)
90 typename comms::util::LazyShallowConditional<
96 return aboveFrom(version, Tag());
99 template <
typename... TParams>
100 static constexpr bool aboveFrom(VersionType, AlwaysTrueTag<TParams...>)
105 template <
typename... TParams>
106 static bool aboveFrom(VersionType version, CompareTag<TParams...>)
111 static_cast<decltype(TFrom)
>(std::numeric_limits<VersionType>::max()),
117 static bool belowUntil(VersionType version)
120 typename comms::util::LazyShallowConditional<
121 static_cast<decltype(TUntil)
>(std::numeric_limits<VersionType>::max()) <= TUntil
126 return belowUntil(version, Tag());
129 template <
typename... TParams>
130 static constexpr bool belowUntil(VersionType, AlwaysTrueTag<TParams...>)
135 template <
typename... TParams>
136 static bool belowUntil(VersionType version, CompareTag<TParams...>)
141 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:1917
comms::option::def::ExistsBetweenVersions< TFrom, TUntil > ExistsBetweenVersions
Same as comms::option::def::ExistsBetweenVersions.
Definition options.h:1926
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.