Skip to content

Commit

Permalink
Make static members of dynamic_modint thread_local
Browse files Browse the repository at this point in the history
  • Loading branch information
adamant-pwn committed Nov 20, 2024
1 parent 7ffac19 commit a357a12
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions cp-algo/number_theory/modint.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -158,14 +158,14 @@ namespace cp_algo::math {
return callback();
}
private:
static Int m;
static Base::UInt im, r1, r2;
static thread_local Int m;
static thread_local Base::UInt im, r1, r2;
};
template<typename Int>
Int dynamic_modint<Int>::m = 1;
Int thread_local dynamic_modint<Int>::m = 1;
template<typename Int>
dynamic_modint<Int>::Base::UInt dynamic_modint<Int>::im = -1;
dynamic_modint<Int>::Base::UInt thread_local dynamic_modint<Int>::im = -1;
template<typename Int>
dynamic_modint<Int>::Base::UInt dynamic_modint<Int>::r2 = 0;
dynamic_modint<Int>::Base::UInt thread_local dynamic_modint<Int>::r2 = 0;
}
#endif // CP_ALGO_MATH_MODINT_HPP

0 comments on commit a357a12

Please sign in to comment.