COMMS
Template library intended to help with implementation of communication protocols.
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 
15 namespace comms
16 {
17 
18 namespace util
19 {
20 
21 namespace detect
22 {
23 
29 template <typename T>
30 constexpr bool hasClearFunc()
31 {
32  return details::HasClearFunc<T>::Value;
33  // return details::PresenceDetector<void, details::HasClearOp, T>::Value;
34 }
35 
41 template <typename T>
42 constexpr bool hasReserveFunc()
43 {
44  return details::HasReserveFunc<T>::Value;
45 }
46 
52 template <typename T>
53 constexpr bool hasResizeFunc()
54 {
55  return details::HasResizeFunc<T>::Value;
56 }
57 
66 template <typename T>
67 constexpr bool hasRemoveSuffixFunc()
68 {
69  return details::HasRemoveSuffixFunc<T>::Value;
70 }
71 
78 template <typename T>
79 constexpr bool hasAssignFunc()
80 {
81  return details::HasAssignFunc<T>::Value;
82 }
83 
90 template <typename T>
91 constexpr bool hasPtrSizeConstructor()
92 {
93  return details::HasPtrSizeConstructor<T>::Value;
94 }
95 
97 template <typename T>
98 constexpr bool isStdSpan()
99 {
100  return details::IsStdSpan<T>::Value;
101 }
102 
108 template <typename T>
109 constexpr 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.