proconlib

This documentation is automatically generated by competitive-verifier/competitive-verifier

View the Project on GitHub anqooqie/proconlib

:heavy_check_mark: Concept for std::complex (tools/complex.hpp)

template <typename T>
concept complex;

It is a concept that represents a type that can be expressed in the form std::complex<...>.

Constraints

Time Complexity

License

Author

Depends on

Required by

Verified with

Code

#ifndef TOOLS_COMPLEX_HPP
#define TOOLS_COMPLEX_HPP

#include <complex>
#include "tools/specialization_of.hpp"

namespace tools {
  template <typename T>
  concept complex = tools::specialization_of<T, std::complex>;
}

#endif
#line 1 "tools/complex.hpp"



#include <complex>
#line 1 "tools/specialization_of.hpp"



#include <type_traits>

namespace tools {
  namespace detail {
    namespace specialization_of {
      template <typename, template <typename...> typename>
      struct trait : std::false_type {};

      template <template <typename...> typename U, typename... Args>
      struct trait<U<Args...>, U> : std::true_type {};
    }
  }

  template <typename T, template <typename...> typename U>
  concept specialization_of = tools::detail::specialization_of::trait<T, U>::value;
}


#line 6 "tools/complex.hpp"

namespace tools {
  template <typename T>
  concept complex = tools::specialization_of<T, std::complex>;
}


Back to top page