SpECTRE Documentation Coverage Report
Current view: top level - Utilities/TypeTraits - HasInequivalence.hpp Hit Total Coverage
Commit: 3c072f0ce967e2e56649d3fa12aa2a0e4fe2a42e Lines: 3 4 75.0 %
Date: 2024-04-23 20:50:18
Legend: Lines: hit not hit

          Line data    Source code
       1           0 : // Distributed under the MIT License.
       2             : // See LICENSE.txt for details.
       3             : 
       4             : #pragma once
       5             : 
       6             : #include <type_traits>
       7             : 
       8             : namespace tt {
       9             : /// @{
      10             : /// \ingroup TypeTraitsGroup
      11             : /// \brief Check if type `T` has operator!= defined.
      12             : ///
      13             : /// \details
      14             : /// Inherits from std::true_type if the type `T` has operator!= defined,
      15             : /// otherwise inherits from std::false_type
      16             : ///
      17             : /// \usage
      18             : /// For any type `T`,
      19             : /// \code
      20             : /// using result = tt::has_inequivalence<T>;
      21             : /// \endcode
      22             : ///
      23             : /// \metareturns
      24             : /// std::bool_constant
      25             : ///
      26             : /// \semantics
      27             : /// If the type `T` has operator!= defined, then
      28             : /// \code
      29             : /// typename result::type = std::true_type;
      30             : /// \endcode
      31             : /// otherwise
      32             : /// \code
      33             : /// typename result::type = std::false_type;
      34             : /// \endcode
      35             : ///
      36             : /// \example
      37             : /// \snippet Test_HasInequivalence.cpp has_inequivalence_example
      38             : /// \see has_equivalence
      39             : /// \tparam T the type we want to know if it has operator!=
      40             : template <typename T, typename U = void>
      41           1 : struct has_inequivalence : std::false_type {};
      42             : 
      43             : /// \cond HIDDEN_SYMBOLS
      44             : template <typename T>
      45             : struct has_inequivalence<
      46             :     T, std::void_t<decltype(std::declval<T>() != std::declval<T>())>>
      47             :     : std::true_type {};
      48             : /// \endcond
      49             : 
      50             : /// \see has_inequivalence
      51             : template <typename T>
      52           1 : constexpr bool has_inequivalence_v = has_inequivalence<T>::value;
      53             : 
      54             : /// \see has_inequivalence
      55             : template <typename T>
      56           1 : using has_inequivalence_t = typename has_inequivalence<T>::type;
      57             : /// @}
      58             : }  // namespace tt

Generated by: LCOV version 1.14