qxLib
predicates.h
Go to the documentation of this file.
1 /**
2 
3  @file predicates.h
4  @author Khrapov
5  @date 26.08.2025
6  @copyright © Nick Khrapov, 2025. All right reserved.
7 
8 **/
9 #pragma once
10 
11 namespace qx::predicates
12 {
13 
14 template<class T>
15 struct validator
16 {
17  static constexpr bool is_valid(const T& value) noexcept
18  {
19  return static_cast<bool>(value);
20  }
21 };
22 
23 template<class T>
24 constexpr bool is_valid(const T& value) noexcept
25 {
26  return validator<T>::is_valid(value);
27 }
28 
29 } // namespace qx::predicates