COMMS
Template library intended to help with implementation of communication protocols.
Loading...
Searching...
No Matches
detect.h
Go to the documentation of this file.
1//
2// Copyright 2017 - 2026 (C). Alex Robenko. All rights reserved.
3//
4// SPDX-License-Identifier: MPL-2.0
5//
6// This Source Code Form is subject to the terms of the Mozilla Public
7// License, v. 2.0. If a copy of the MPL was not distributed with this
8// file, You can obtain one at http://mozilla.org/MPL/2.0/.
9
12
13#pragma once
14
16
17namespace comms
18{
19
20namespace util
21{
22
23namespace detect
24{
25
31template <typename T>
32constexpr bool hasClearFunc()
33{
34 return details::HasClearFunc<T>::Value;
35 // return details::PresenceDetector<void, details::HasClearOp, T>::Value;
36}
37
43template <typename T>
44constexpr bool hasReserveFunc()
45{
46 return details::HasReserveFunc<T>::Value;
47}
48
54template <typename T>
55constexpr bool hasResizeFunc()
56{
57 return details::HasResizeFunc<T>::Value;
58}
59
68template <typename T>
69constexpr bool hasRemoveSuffixFunc()
70{
71 return details::HasRemoveSuffixFunc<T>::Value;
72}
73
80template <typename T>
81constexpr bool hasAssignFunc()
82{
83 return details::HasAssignFunc<T>::Value;
84}
85
92template <typename T>
93constexpr bool hasPtrSizeConstructor()
94{
95 return details::HasPtrSizeConstructor<T>::Value;
96}
97
99template <typename T>
100constexpr bool isStdSpan()
101{
102 return details::IsStdSpan<T>::Value;
103}
104
110template <typename T>
111constexpr bool hasMaxSizeFunc()
112{
113 return details::HasMaxSizeFunc<T>::Value;
114}
115
116} // namespace detect
117
118} // namespace util
119
120} // namespace comms
constexpr bool isStdSpan()
Detect whether provided type is std::span.
Definition detect.h:100
constexpr bool hasRemoveSuffixFunc()
Detect whether provided type has remove_suffix() member function.
Definition detect.h:69
constexpr bool hasReserveFunc()
Detect whether provided type has reserve() member function.
Definition detect.h:44
constexpr bool hasClearFunc()
Detect whether provided type has clear() member function.
Definition detect.h:32
constexpr bool hasPtrSizeConstructor()
Detect whether provided type has a constructor that receives a pointer + size parameters.
Definition detect.h:93
constexpr bool hasAssignFunc()
Detect whether provided type has assign() member function which can receive two pointers in its argum...
Definition detect.h:81
constexpr bool hasResizeFunc()
Detect whether provided type has resize() member function.
Definition detect.h:55
constexpr bool hasMaxSizeFunc()
Detect whether provided type has max_size() member function.
Definition detect.h:111
Main namespace for all classes / functions of COMMS library.