proconlib

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

View the Project on GitHub anqooqie/proconlib

:heavy_check_mark: Concept for a type that can be passed for range adaptors multi times (tools/available_for_multiple_range_adaptors.hpp)

template <typename T>
concept available_for_multiple_range_adaptors = std::ranges::forward_range<T>
  && std::ranges::viewable_range<T>
  && std::copyable<std::views::all_t<T>>;

It is a concept that represents a type that can be passed for range adaptors multi times.

Constraints

Time Complexity

License

Author

Depends on

Required by

Verified with

Code

#ifndef TOOLS_AVAILABLE_FOR_MULTIPLE_RANGE_ADAPTORS_HPP
#define TOOLS_AVAILABLE_FOR_MULTIPLE_RANGE_ADAPTORS_HPP

#include <concepts>
#include <ranges>
#include <type_traits>
#include "tools/specialization_of.hpp"

namespace tools {
  template <typename T>
  concept available_for_multiple_range_adaptors = std::ranges::forward_range<T>
    && std::ranges::viewable_range<T>
    && std::copyable<std::views::all_t<T>>;
}

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



#include <concepts>
#include <ranges>
#include <type_traits>
#line 1 "tools/specialization_of.hpp"



#line 5 "tools/specialization_of.hpp"

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 8 "tools/available_for_multiple_range_adaptors.hpp"

namespace tools {
  template <typename T>
  concept available_for_multiple_range_adaptors = std::ranges::forward_range<T>
    && std::ranges::viewable_range<T>
    && std::copyable<std::views::all_t<T>>;
}


Back to top page