Skip to content

Commit 7099700

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 const reference. Changed the to return a const references. This makes them work with boost::iterator_ranges.
1 parent cb331f8 commit 7099700

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_type const & headers() const {
8787
return _headers;
8888
}
8989

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

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

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

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

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

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

0 commit comments

Comments
 (0)