proconlib

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

View the Project on GitHub anqooqie/proconlib

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

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

template <typename T>
inline constexpr bool is_arithmetic_v = is_arithmetic<T>::value;

tools::is_arithmetic_v<T> is equivalent to std::is_arithmetic_v<T> || std::is_same_v<std::remove_cv_t<T>, tools::int128_t> || std::is_same_v<std::remove_cv_t<T>, tools::uint128_t>. When using libstdc++ with -std=c++... option, std::is_arithmetic_v<tools::int128_t> and std::is_arithmetic_v<tools::uint128_t> are treated as false, but with tools::is_arithmetic, they can be treated as true.

Constraints

Time Complexity

License

Author

Required by

Verified with

Code

#ifndef TOOLS_IS_ARITHMETIC_HPP
#define TOOLS_IS_ARITHMETIC_HPP

#include <type_traits>

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

  template <typename T>
  inline constexpr bool is_arithmetic_v = ::tools::is_arithmetic<T>::value;
}

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



#include <type_traits>

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

  template <typename T>
  inline constexpr bool is_arithmetic_v = ::tools::is_arithmetic<T>::value;
}


Back to top page