SpECTRE Documentation Coverage Report
Current view: top level - Utilities/TypeTraits - IsComplexOfFundamental.hpp Coverage Total Hit
Commit: 0d1d717af84a81fb1284a20c4013708fe85cc2f0 Lines: 50.0 % 4 2
Test Date: 2026-10-22 17:29:42
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 <complex>
       7              : #include <type_traits>
       8              : 
       9              : namespace tt {
      10              : /// @{
      11              : /// \ingroup TypeTraitsGroup
      12              : /// \brief Determines if a type `T` is a `std::complex` of a fundamental type,
      13              : /// is a `std::true_type` if so, and otherwise is a `std::false_type`
      14              : ///
      15              : /// \snippet Test_IsComplexOfFundamental.cpp is_complex_of_fundamental
      16              : template <typename T, typename = std::bool_constant<true>>
      17            1 : struct is_complex_of_fundamental : std::false_type {};
      18              : 
      19              : /// \cond
      20              : // this version will only pattern match if `T` is both complex and a fundamental
      21              : // type
      22              : template <typename T>
      23              : struct is_complex_of_fundamental<std::complex<T>,
      24              :                                  std::bool_constant<std::is_fundamental_v<T>>>
      25              :     : std::true_type {};
      26              : /// \endcond
      27              : /// @}
      28              : 
      29              : template <typename T>
      30            0 : constexpr bool is_complex_of_fundamental_v =
      31              :     is_complex_of_fundamental<T>::value;
      32              : 
      33              : /// \ingroup TypeTraitsGroup
      34              : /// \brief Evaluates to `true` if type `T` is a `std::complex` of a fundamental
      35              : /// type or if `T` is a fundamental type.
      36              : template <typename T>
      37            1 : constexpr bool is_complex_or_fundamental_v =
      38              :     is_complex_of_fundamental_v<T> or std::is_fundamental_v<T>;
      39              : }  // namespace tt
        

Generated by: LCOV version 2.0-1