From ae5a497131b75e463b900728cf534d38fc04ee9b Mon Sep 17 00:00:00 2001 From: ei1333 Date: Tue, 14 Apr 2026 17:16:43 +0000 Subject: [PATCH] Update template.hpp --- template/template.hpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/template/template.hpp b/template/template.hpp index a1372e98..01c3d4d8 100644 --- a/template/template.hpp +++ b/template/template.hpp @@ -33,7 +33,7 @@ istream& operator>>(istream& is, pair& p) { template ostream& operator<<(ostream& os, const vector& v) { - for (int i = 0; i < (int)v.size(); i++) { + for (size_t i = 0; i < v.size(); i++) { os << v[i] << (i + 1 != v.size() ? " " : ""); } return os; @@ -46,12 +46,12 @@ istream& operator>>(istream& is, vector& v) { } template -inline bool chmax(T1& a, T2 b) { +bool chmax(T1& a, T2 b) { return a < b && (a = b, true); } template -inline bool chmin(T1& a, T2 b) { +bool chmin(T1& a, T2 b) { return a > b && (a = b, true); } @@ -66,12 +66,12 @@ auto make_v(size_t a, Ts... ts) { } template -typename enable_if::value == 0>::type fill_v(T& t, const V& v) { +enable_if_t == 0> fill_v(T& t, const V& v) { t = v; } template -typename enable_if::value != 0>::type fill_v(T& t, const V& v) { +enable_if_t != 0> fill_v(T& t, const V& v) { for (auto& e : t) fill_v(e, v); } @@ -86,6 +86,6 @@ struct FixPoint : F { }; template -inline decltype(auto) MFP(F&& f) { +decltype(auto) MFP(F&& f) { return FixPoint{std::forward(f)}; }