Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit7099700

Browse files
committed
Return const reference from get functions
The const versions of destination(), source(), body()and headers() returned either a temporary or a non constreference. Changed the to return a const references.This makes them work with boost::iterator_ranges.
1 parentcb331f8 commit7099700

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

‎boost/network/message.hpp‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ namespace boost { namespace network {
8383
_headers.erase(key);
8484
}
8585

86-
headers_container_type &headers()const {
86+
headers_container_typeconst&headers()const {
8787
return _headers;
8888
}
8989

@@ -95,7 +95,7 @@ namespace boost { namespace network {
9595
_body = body_;
9696
}
9797

98-
string_typebody()const {
98+
string_typeconst &body()const {
9999
return _body;
100100
}
101101

@@ -107,7 +107,7 @@ namespace boost { namespace network {
107107
_source = source_;
108108
}
109109

110-
string_typesource()const {
110+
string_typeconst &source()const {
111111
return _source;
112112
}
113113

@@ -119,7 +119,7 @@ namespace boost { namespace network {
119119
_destination = destination_;
120120
}
121121

122-
string_typedestination()const {
122+
string_typeconst &destination()const {
123123
return _destination;
124124
}
125125

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp