proconlib

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

View the Project on GitHub anqooqie/proconlib

:heavy_check_mark: std::is_unsigned extended for tools::int128_t and tools::uint128_t (tools/is_unsigned.hpp)

template <typename T>
struct is_unsigned {
  static constexpr bool value;
};

template <typename T>
inline constexpr bool is_unsigned_v = is_unsigned<T>::value;

tools::is_unsigned_v<T> is equivalent to std::is_unsigned_v<T> || std::is_same_v<std::remove_cv_t<T>, tools::uint128_t>. When using libstdc++ with -std=c++... option, std::is_unsigned_v<tools::uint128_t> is treated as false, but with tools::is_unsigned, it can be treated as true.

Constraints

Time Complexity

License

Author

Required by

Verified with

Code

#ifndef TOOLS_IS_UNSIGNED_HPP
#define TOOLS_IS_UNSIGNED_HPP

#include <type_traits>

namespace tools {
  template <typename T>
  struct is_unsigned : ::std::is_unsigned<T> {};

  template <typename T>
  inline constexpr bool is_unsigned_v = ::tools::is_unsigned<T>::value;
}

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



#include <type_traits>

namespace tools {
  template <typename T>
  struct is_unsigned : ::std::is_unsigned<T> {};

  template <typename T>
  inline constexpr bool is_unsigned_v = ::tools::is_unsigned<T>::value;
}


Back to top page