Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
shogo314 committed Feb 11, 2024
1 parent 6a7c117 commit 85479eb
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions cpp/rolling-hash.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -133,8 +133,8 @@ struct RHString {
/**
* @brief charやunsigned long longなどで初期化する
*/
template <class T, std::enable_if_t<!is_range_v<T> && !std::is_convertible_v<T, std::string_view>, std::nullptr_t> = nullptr>
RHString(RollingHash& rh, T x) : rh(rh) {
template <class T, std::enable_if_t<std::is_convertible_v<T, unsigned long long> && !std::is_convertible_v<T, std::string_view>, std::nullptr_t> = nullptr>
RHString(RollingHash& rh, T&& x) : rh(rh) {
sz = 1;
hash1 = x;
hash2 = x;
Expand Down Expand Up @@ -197,7 +197,7 @@ struct RHString {
/**
* @brief charやunsigned long longなどを再代入する
*/
template <class T, std::enable_if_t<!is_range_v<T> && !std::is_convertible_v<T, std::string_view>, std::nullptr_t> = nullptr>
template <class T, std::enable_if_t<std::is_convertible_v<T, unsigned long long> && !std::is_convertible_v<T, std::string_view>, std::nullptr_t> = nullptr>
void assign(T&& x) {
sz = 1;
hash1 = x;
Expand Down Expand Up @@ -230,7 +230,7 @@ struct RHString {
/**
* @brief charやunsigned long longなどを再代入する
*/
template <class T, std::enable_if_t<!is_range_v<T> && !std::is_convertible_v<T, std::string_view>, std::nullptr_t> = nullptr>
template <class T, std::enable_if_t<std::is_convertible_v<T, unsigned long long> && !std::is_convertible_v<T, std::string_view>, std::nullptr_t> = nullptr>
RHString& operator=(T&& x) {
assign(x);
return *this;
Expand Down

0 comments on commit 85479eb

Please sign in to comment.