NVIDIA DeepStream SDK API Reference

9.2 Release
includes/opentelemetry/nostd/detail/functional.h
Go to the documentation of this file.
1 // Copyright The OpenTelemetry Authors
2 // SPDX-License-Identifier: Apache-2.0
3 
4 #pragma once
5 
6 #include <utility>
7 
8 #include "opentelemetry/version.h"
9 
10 #define OPENTELEMETRY_RETURN(...) \
11  noexcept(noexcept(__VA_ARGS__))->decltype(__VA_ARGS__) \
12  { \
13  return __VA_ARGS__; \
14  }
15 
17 namespace nostd
18 {
19 namespace detail
20 {
21 struct equal_to
22 {
23  template <typename Lhs, typename Rhs>
24  inline constexpr auto operator()(Lhs &&lhs, Rhs &&rhs) const
25  OPENTELEMETRY_RETURN(std::forward<Lhs>(lhs) == std::forward<Rhs>(rhs))
26 };
27 
29 {
30  template <typename Lhs, typename Rhs>
31  inline constexpr auto operator()(Lhs &&lhs, Rhs &&rhs) const
32  OPENTELEMETRY_RETURN(std::forward<Lhs>(lhs) != std::forward<Rhs>(rhs))
33 };
34 
35 struct less
36 {
37  template <typename Lhs, typename Rhs>
38  inline constexpr auto operator()(Lhs &&lhs, Rhs &&rhs) const
39  OPENTELEMETRY_RETURN(std::forward<Lhs>(lhs) < std::forward<Rhs>(rhs))
40 };
41 
42 struct greater
43 {
44  template <typename Lhs, typename Rhs>
45  inline constexpr auto operator()(Lhs &&lhs, Rhs &&rhs) const
46  OPENTELEMETRY_RETURN(std::forward<Lhs>(lhs) > std::forward<Rhs>(rhs))
47 };
48 
49 struct less_equal
50 {
51  template <typename Lhs, typename Rhs>
52  inline constexpr auto operator()(Lhs &&lhs, Rhs &&rhs) const
53  OPENTELEMETRY_RETURN(std::forward<Lhs>(lhs) <= std::forward<Rhs>(rhs))
54 };
55 
57 {
58  template <typename Lhs, typename Rhs>
59  inline constexpr auto operator()(Lhs &&lhs, Rhs &&rhs) const
60  OPENTELEMETRY_RETURN(std::forward<Lhs>(lhs) >= std::forward<Rhs>(rhs))
61 };
62 } // namespace detail
63 } // namespace nostd
65 
66 #undef OPENTELEMETRY_RETURN
OPENTELEMETRY_RETURN
#define OPENTELEMETRY_RETURN(...)
Definition: includes/opentelemetry/nostd/detail/functional.h:10
nostd
Definition: includes/opentelemetry/nostd/function_ref.h:14
nostd::detail::greater
Definition: includes/opentelemetry/nostd/detail/functional.h:42
OPENTELEMETRY_BEGIN_NAMESPACE
#define OPENTELEMETRY_BEGIN_NAMESPACE
Definition: includes/opentelemetry/version.h:21
nostd::detail::greater_equal
Definition: includes/opentelemetry/nostd/detail/functional.h:56
OPENTELEMETRY_END_NAMESPACE
#define OPENTELEMETRY_END_NAMESPACE
Definition: includes/opentelemetry/version.h:24
nostd::detail::equal_to
Definition: includes/opentelemetry/nostd/detail/functional.h:21
nostd::detail::not_equal_to
Definition: includes/opentelemetry/nostd/detail/functional.h:28
nostd::detail::less
Definition: includes/opentelemetry/nostd/detail/functional.h:35
nostd::detail::less_equal
Definition: includes/opentelemetry/nostd/detail/functional.h:49