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 - 2024 (C). Alex Robenko. All rights reserved.
3//
4// This Source Code Form is subject to the terms of the Mozilla Public
5// License, v. 2.0. If a copy of the MPL was not distributed with this
6// file, You can obtain one at http://mozilla.org/MPL/2.0/.
7
10
11#pragma once
12
14
15namespace comms
16{
17
18namespace util
19{
20
21namespace detect
22{
23
29template <typename T>
30constexpr bool hasClearFunc()
31{
32 return details::HasClearFunc<T>::Value;
33 // return details::PresenceDetector<void, details::HasClearOp, T>::Value;
34}
35
41template <typename T>
42constexpr bool hasReserveFunc()
43{
44 return details::HasReserveFunc<T>::Value;
45}
46
52template <typename T>
53constexpr bool hasResizeFunc()
54{
55 return details::HasResizeFunc<T>::Value;
56}
57
66template <typename T>
67constexpr bool hasRemoveSuffixFunc()
68{
69 return details::HasRemoveSuffixFunc<T>::Value;
70}
71
78template <typename T>
79constexpr bool hasAssignFunc()
80{
81 return details::HasAssignFunc<T>::Value;
82}
83
90template <typename T>
91constexpr bool hasPtrSizeConstructor()
92{
93 return details::HasPtrSizeConstructor<T>::Value;
94}
95
97template <typename T>
98constexpr bool isStdSpan()
99{
100 return details::IsStdSpan<T>::Value;
101}
102
108template <typename T>
109constexpr bool hasMaxSizeFunc()
110{
111 return details::HasMaxSizeFunc<T>::Value;
112}
113
114} // namespace detect
115
116} // namespace util
117
118} // namespace comms
constexpr bool isStdSpan()
Detect whether provided type is std::span.
Definition detect.h:98
constexpr bool hasRemoveSuffixFunc()
Detect whether provided type has remove_suffix() member function.
Definition detect.h:67
constexpr bool hasReserveFunc()
Detect whether provided type has reserve() member function.
Definition detect.h:42
constexpr bool hasClearFunc()
Detect whether provided type has clear() member function.
Definition detect.h:30
constexpr bool hasPtrSizeConstructor()
Detect whether provided type has a constructor that receives a pointer + size parameters.
Definition detect.h:91
constexpr bool hasAssignFunc()
Detect whether provided type has assign() member function which can receive two pointers in its argum...
Definition detect.h:79
constexpr bool hasResizeFunc()
Detect whether provided type has resize() member function.
Definition detect.h:53
constexpr bool hasMaxSizeFunc()
Detect whether provided type has max_size() member function.
Definition detect.h:109
Main namespace for all classes / functions of COMMS library.