Skip to content

Commit 937df39

Browse files
authored
Merge pull request #2306 from mazunki/fix-warn-prec-whitespace-units
fix deprecation warning: preceding whitespace to operator
2 parents 94fe17b + 887cf15 commit 937df39

File tree

14 files changed

+47
-47
lines changed

14 files changed

+47
-47
lines changed

api/fs/path.hpp

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -44,38 +44,38 @@ namespace fs {
4444
size_t size() const noexcept
4545
{ return stk.size(); }
4646

47-
const std::string& operator [] (const int i) const
47+
const std::string& operator[](const int i) const
4848
{ return stk.at(i); }
4949

5050
int state() const noexcept
5151
{ return state_; }
5252

53-
Path& operator = (const std::string& p) {
53+
Path& operator=(const std::string& p) {
5454
stk.clear();
5555
parse_add(p);
5656
return *this;
5757
}
5858

59-
Path& operator += (const std::string& p) {
59+
Path& operator+=(const std::string& p) {
6060
this->state_ = parse_add(p);
6161
return *this;
6262
}
6363

64-
Path operator + (const std::string& p) const {
64+
Path operator+(const std::string& p) const {
6565
Path np = Path(*this);
6666
np.state_ = np.parse_add(p);
6767
return np;
6868
}
6969

70-
bool operator == (const Path& p) const {
70+
bool operator==(const Path& p) const {
7171
if (stk.size() not_eq p.stk.size()) return false;
7272
return this->to_string() == p.to_string();
7373
}
7474

75-
bool operator != (const Path& p) const
76-
{ return not this->operator == (p); }
75+
bool operator!=(const Path& p) const
76+
{ return not this->operator==(p); }
7777

78-
bool operator == (const std::string& p) const
78+
bool operator==(const std::string& p) const
7979
{ return *this == Path(p); }
8080

8181
bool empty() const noexcept

api/net/http/cookie.hpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -51,9 +51,9 @@ class Cookie {
5151

5252
Cookie(Cookie&&) noexcept = default;
5353

54-
Cookie& operator = (const Cookie&) = default;
54+
Cookie& operator=(const Cookie&) = default;
5555

56-
Cookie& operator = (Cookie&&) = default;
56+
Cookie& operator=(Cookie&&) = default;
5757

5858
~Cookie() = default;
5959

@@ -219,11 +219,11 @@ class Cookie {
219219
// Because we want a map of Cookies in CookieJar we need to set rules
220220
// for comparing Cookies and deciding if two Cookies are the same or not:
221221

222-
bool operator < (const Cookie& a, const Cookie& b) noexcept;
222+
bool operator<(const Cookie& a, const Cookie& b) noexcept;
223223

224-
bool operator == (const Cookie& a, const Cookie& b) noexcept;
224+
bool operator==(const Cookie& a, const Cookie& b) noexcept;
225225

226-
std::ostream& operator << (std::ostream& output_device, const Cookie& cookie);
226+
std::ostream& operator<<(std::ostream& output_device, const Cookie& cookie);
227227

228228
}; // < namespace http
229229

api/net/http/header.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,12 +79,12 @@ class Header {
7979
///
8080
/// Default assignment operator
8181
///
82-
Header& operator = (const Header&) = default;
82+
Header& operator=(const Header&) = default;
8383

8484
///
8585
/// Default move assignemt operator
8686
///
87-
Header& operator = (Header&&) noexcept = default;
87+
Header& operator=(Header&&) noexcept = default;
8888

8989
///
9090
/// Add a new field to the current set

api/net/http/message.hpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -68,12 +68,12 @@ class Message {
6868
///
6969
/// Default copy assignment operator
7070
///
71-
Message& operator = (const Message&) = default;
71+
Message& operator=(const Message&) = default;
7272

7373
///
7474
/// Default move assignment operator
7575
///
76-
Message& operator = (Message&&) = default;
76+
Message& operator=(Message&&) = default;
7777

7878
///
7979
/// Get a modifiable reference to the header object
@@ -207,7 +207,7 @@ class Message {
207207
///
208208
/// Add a set of headers to a message
209209
///
210-
Message& operator << (Message& res, const Header_set& headers);
210+
Message& operator<<(Message& res, const Header_set& headers);
211211

212212
/**--^----------- Helper Functions -----------^--**/
213213

api/net/http/request.hpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -79,12 +79,12 @@ class Request : public Message {
7979
///
8080
/// Default copy assignment operator
8181
///
82-
Request& operator = (Request&) = default;
82+
Request& operator=(Request&) = default;
8383

8484
///
8585
/// Default move assignment operator
8686
///
87-
Request& operator = (Request&&) = default;
87+
Request& operator=(Request&&) = default;
8888

8989
///
9090
/// Parse the information supplied to the Request object
@@ -199,7 +199,7 @@ class Request : public Message {
199199
///
200200
/// @return The object that invoked this method
201201
///
202-
Request& operator << (const std::string& chunk);
202+
Request& operator<<(const std::string& chunk);
203203
private:
204204
///
205205
/// Class data members

api/net/http/response.hpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -83,12 +83,12 @@ class Response : public Message {
8383
///
8484
/// Default copy assignment operator
8585
///
86-
Response& operator = (const Response&) = default;
86+
Response& operator=(const Response&) = default;
8787

8888
///
8989
/// Default move assignment operator
9090
///
91-
Response& operator = (Response&&) = default;
91+
Response& operator=(Response&&) = default;
9292

9393
///
9494
/// Parse the information supplied to the Response object
@@ -170,7 +170,7 @@ class Response : public Message {
170170
///
171171
/// @return The object that invoked this method
172172
///
173-
Response& operator << (const std::string& chunk);
173+
Response& operator<<(const std::string& chunk);
174174
private:
175175
///
176176
/// Class data members

api/net/socket.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -206,7 +206,7 @@ namespace std {
206206
template<>
207207
struct hash<net::Quadruple> {
208208
public:
209-
size_t operator () (const net::Quadruple& key) const noexcept {
209+
size_t operator()(const net::Quadruple& key) const noexcept {
210210
const auto h1 = std::hash<net::Socket>{}(key.src);
211211
const auto h2 = std::hash<net::Socket>{}(key.dst);
212212
return h1 ^ h2;

api/util/units.hpp

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -31,19 +31,19 @@ inline namespace literals
3131
*/
3232
using int_t = unsigned long long;
3333

34-
constexpr auto operator"" _b ( int_t x)
34+
constexpr auto operator""_b ( int_t x)
3535
{ return 1ULL * x; }
3636

37-
constexpr auto operator"" _KiB ( int_t x)
37+
constexpr auto operator""_KiB ( int_t x)
3838
{ return 1024_b * x; }
3939

40-
constexpr auto operator"" _MiB ( int_t x )
40+
constexpr auto operator""_MiB ( int_t x )
4141
{ return 1024_KiB * x; }
4242

43-
constexpr auto operator"" _GiB ( int_t x )
43+
constexpr auto operator""_GiB ( int_t x )
4444
{ return 1024_MiB * x; }
4545

46-
constexpr auto operator"" _TiB ( int_t x )
46+
constexpr auto operator""_TiB ( int_t x )
4747
{ return 1024_GiB * x; }
4848

4949

@@ -56,19 +56,19 @@ inline namespace literals
5656
using MHz = std::chrono::duration<double, std::mega>;
5757
using GHz = std::chrono::duration<double, std::giga>;
5858

59-
constexpr Hz operator"" _hz(long double d) {
59+
constexpr Hz operator""_hz(long double d) {
6060
return Hz(d);
6161
}
6262

63-
constexpr KHz operator"" _khz(long double d) {
63+
constexpr KHz operator""_khz(long double d) {
6464
return KHz(d);
6565
}
6666

67-
constexpr MHz operator"" _mhz(long double d) {
67+
constexpr MHz operator""_mhz(long double d) {
6868
return MHz(d);
6969
}
7070

71-
constexpr GHz operator"" _ghz(long double d) {
71+
constexpr GHz operator""_ghz(long double d) {
7272
return GHz(d);
7373
}
7474

api/util/uri.hpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -267,7 +267,7 @@ class URI {
267267
///
268268
/// @return The object that invoked this method
269269
///
270-
URI& operator << (const std::string& chunk);
270+
URI& operator<<(const std::string& chunk);
271271

272272
///
273273
/// Parse the information supplied to the URI object
@@ -316,7 +316,7 @@ class URI {
316316
///
317317
/// @return true if lhs is less-than rhs, false otherwise
318318
///
319-
bool operator < (const URI& lhs, const URI& rhs) noexcept;
319+
bool operator<(const URI& lhs, const URI& rhs) noexcept;
320320

321321
///
322322
/// Operator to compare two {URI} objects for equality
@@ -331,7 +331,7 @@ bool operator < (const URI& lhs, const URI& rhs) noexcept;
331331
///
332332
/// @todo IPv6 authority comparison
333333
///
334-
bool operator == (const URI& lhs, const URI& rhs) noexcept;
334+
bool operator==(const URI& lhs, const URI& rhs) noexcept;
335335

336336
///
337337
/// Operator to stream the contents of a {URI} to the specified

src/net/http/cookie.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,17 +19,17 @@
1919

2020
namespace http {
2121

22-
bool operator < (const Cookie& a, const Cookie& b) noexcept {
22+
bool operator<(const Cookie& a, const Cookie& b) noexcept {
2323
return std::hash<std::string>{}(a.get_name() + a.get_value())
2424
< std::hash<std::string>{}(b.get_name() + b.get_value());
2525
}
2626

27-
bool operator == (const Cookie& a, const Cookie& b) noexcept {
27+
bool operator==(const Cookie& a, const Cookie& b) noexcept {
2828
return std::hash<std::string>{}(a.get_name() + a.get_value())
2929
== std::hash<std::string>{}(b.get_name() + b.get_value());
3030
}
3131

32-
std::ostream& operator << (std::ostream& output_device, const Cookie& cookie) {
32+
std::ostream& operator<<(std::ostream& output_device, const Cookie& cookie) {
3333
return output_device << cookie.to_string();
3434
}
3535

0 commit comments

Comments
 (0)