File tree 2 files changed +12
-20
lines changed
2 files changed +12
-20
lines changed Original file line number Diff line number Diff line change @@ -172,9 +172,18 @@ namespace ccf::nonstd
172
172
173
173
/* * These convert strings to upper or lower case, in-place
174
174
*/
175
- void to_upper (std::string& s);
176
-
177
- void to_lower (std::string& s);
175
+ static inline void to_upper (std::string& s)
176
+ {
177
+ std::transform (s.begin (), s.end (), s.begin (), [](unsigned char c) {
178
+ return std::toupper (c);
179
+ });
180
+ }
181
+ static inline void to_lower (std::string& s)
182
+ {
183
+ std::transform (s.begin (), s.end (), s.begin (), [](unsigned char c) {
184
+ return std::tolower (c);
185
+ });
186
+ }
178
187
179
188
// / Iterate through tuple, calling functor on each element
180
189
template <size_t I = 0 , typename F, typename ... Ts>
Original file line number Diff line number Diff line change 1
1
// Copyright (c) Microsoft Corporation. All rights reserved.
2
2
// Licensed under the Apache 2.0 License.
3
3
4
- #include " ccf/ds/nonstd.h"
5
-
6
4
#include " ds/nonstd.h"
7
5
8
6
#include < algorithm>
14
12
15
13
namespace ccf ::nonstd
16
14
{
17
- // Implementations for ccf/ds/nonstd.h
18
- void to_upper (std::string& s)
19
- {
20
- std::transform (s.begin (), s.end (), s.begin (), [](unsigned char c) {
21
- return std::toupper (c);
22
- });
23
- }
24
-
25
- void to_lower (std::string& s)
26
- {
27
- std::transform (s.begin (), s.end (), s.begin (), [](unsigned char c) {
28
- return std::tolower (c);
29
- });
30
- }
31
-
32
15
// Implementations for ds/nonstd.h
33
16
std::string camel_case (
34
17
std::string s, bool camel_first, const std::string& separator_regex)
You can’t perform that action at this time.
0 commit comments