proconlib

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

View the Project on GitHub anqooqie/proconlib

:heavy_check_mark: Concept for the specialized type of U (tools/specialization_of.hpp)

template <typename T, template <typename...> typename U>
concept specialization_of;

It is a concept that represents a specialized type of U.

Constraints

Time Complexity

License

Author

Required by

Verified with

Code

#ifndef TOOLS_SPECIALIZATION_OF_HPP
#define 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;
}

#endif
#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;
}


Back to top page