@@ -35,27 +35,49 @@ size_t cnt = std::count_if(v.begin(),
3535 });
3636```
3737
38+ >
3839> template \<typename StringT = std::wstring_view\>
40+ >
3941> struct CaseInsensitiveEqual
42+ >
4043> {
44+ >
4145> bool operator()(StringT const& lhs, StringT const& rhs) const
46+ >
4247> {
48+ >
4349> using namespace std;
50+ >
4451> return lhs.size() == rhs.size()
52+ >
4553> && equal(lhs.begin(),
54+ >
4655> lhs.end(),
56+ >
4757> rhs.begin(),
58+ >
4859> \[\](auto l, auto r) {
60+ >
4961> return tolower(l) == tolower(r);
62+ >
5063> });
64+ >
5165> }
66+ >
5267> };
5368>
69+ >
70+ >
5471> size_t cnt = std\:\:count_if(v.begin(),
72+ >
5573> v.end(),
74+ >
5675> \[\](auto const& str) {
76+ >
5777> return CaseInsensitiveEqual\<
78+ >
5879> decltype(v)\:\:value_type\> {}(str, "hello");
80+ >
5981> });
6082
6183λλΉκ° κ°μ ν°νΈλ₯Ό μ¬μ©νλ©΄ κ° μ€μ λ€μ¬μ°κΈ°λ₯Ό λ§μΆ μ μλ κ²μ λ°ν΄, λλΉκ° μλ‘ λ€λ₯΄λ©΄ λ€μ¬μ°κΈ°μ κ°κ²©μ μ‘°μ νκΈ° νλ€λ€λ κ²μ μ μ μμ΅λλ€.
0 commit comments