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

Commit516e105

Browse files
committed
Replaced boost::array with std::array.
1 parent3bb73e1 commit516e105

File tree

5 files changed

+21
-17
lines changed

5 files changed

+21
-17
lines changed

‎boost/network/protocol/http/client/connection/async_normal.hpp‎

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -221,7 +221,7 @@ struct http_async_connection
221221
}
222222
}
223223
delegate_->read_some(
224-
boost::asio::mutable_buffers_1(this->part.c_array(),
224+
boost::asio::mutable_buffers_1(this->part.data(),
225225
this->part.size()),
226226
request_strand_.wrap(boost::bind(
227227
&this_type::handle_received_data,this_type::shared_from_this(),
@@ -309,7 +309,8 @@ struct http_async_connection
309309
this->body_promise.set_value("");
310310
this->destination_promise.set_value("");
311311
this->source_promise.set_value("");
312-
this->part.assign('\0');
312+
// this->part.assign('\0');
313+
boost::copy("\0",std::begin(this->part));
313314
this->response_parser_.reset();
314315
return;
315316
}
@@ -335,7 +336,7 @@ struct http_async_connection
335336
callback(make_iterator_range(begin, end), ec);
336337

337338
delegate_->read_some(
338-
boost::asio::mutable_buffers_1(this->part.c_array(),
339+
boost::asio::mutable_buffers_1(this->part.data(),
339340
this->part.size()),
340341
request_strand_.wrap(boost::bind(
341342
&this_type::handle_received_data,
@@ -382,7 +383,8 @@ struct http_async_connection
382383
// TODO(dberris): set the destination value somewhere!
383384
this->destination_promise.set_value("");
384385
this->source_promise.set_value("");
385-
this->part.assign('\0');
386+
// this->part.assign('\0');
387+
boost::copy("\0",std::begin(this->part));
386388
this->response_parser_.reset();
387389
this->timer_.cancel();
388390
}else {
@@ -398,7 +400,7 @@ struct http_async_connection
398400
std::advance(end, bytes_transferred);
399401
callback(make_iterator_range(begin, end), ec);
400402
delegate_->read_some(
401-
boost::asio::mutable_buffers_1(this->part.c_array(),
403+
boost::asio::mutable_buffers_1(this->part.data(),
402404
this->part.size()),
403405
request_strand_.wrap(boost::bind(
404406
&this_type::handle_received_data,

‎boost/network/protocol/http/client/connection/async_protocol_handler.hpp‎

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010

1111
#include<iterator>
1212
#include<cstdint>
13+
#include<array>
1314
#include<boost/fusion/tuple/tuple.hpp>
1415
#include<boost/fusion/tuple/tuple_tie.hpp>
1516
#include<boost/logic/tribool.hpp>
@@ -140,7 +141,7 @@ struct http_async_protocol_handler {
140141
std::end(result_range));
141142
part_begin = part.begin();
142143
delegate_->read_some(
143-
boost::asio::mutable_buffers_1(part.c_array(), part.size()),
144+
boost::asio::mutable_buffers_1(part.data(), part.size()),
144145
callback);
145146
}
146147
return parsed_ok;
@@ -186,7 +187,7 @@ struct http_async_protocol_handler {
186187
std::end(result_range));
187188
part_begin = part.begin();
188189
delegate_->read_some(
189-
boost::asio::mutable_buffers_1(part.c_array(), part.size()),
190+
boost::asio::mutable_buffers_1(part.data(), part.size()),
190191
callback);
191192
}
192193
return parsed_ok;
@@ -231,7 +232,7 @@ struct http_async_protocol_handler {
231232
std::end(result_range));
232233
part_begin = part.begin();
233234
delegate_->read_some(
234-
boost::asio::mutable_buffers_1(part.c_array(), part.size()),
235+
boost::asio::mutable_buffers_1(part.data(), part.size()),
235236
callback);
236237
}
237238
return parsed_ok;
@@ -318,7 +319,7 @@ struct http_async_protocol_handler {
318319
std::end(result_range));
319320
part_begin = part.begin();
320321
delegate_->read_some(
321-
boost::asio::mutable_buffers_1(part.c_array(), part.size()),
322+
boost::asio::mutable_buffers_1(part.data(), part.size()),
322323
callback);
323324
}
324325
returnfusion::make_tuple(
@@ -332,12 +333,12 @@ struct http_async_protocol_handler {
332333
partial_parsed.append(part_begin, bytes);
333334
part_begin = part.begin();
334335
delegate_->read_some(
335-
boost::asio::mutable_buffers_1(part.c_array(), part.size()), callback);
336+
boost::asio::mutable_buffers_1(part.data(), part.size()), callback);
336337
}
337338

338339
typedef response_parser<Tag> response_parser_type;
339340
// TODO(dberris): make 1024 go away and become a configurable value.
340-
typedefboost::array<typename char_<Tag>::type,1024> buffer_type;
341+
typedefstd::array<typename char_<Tag>::type,1024> buffer_type;
341342

342343
response_parser_type response_parser_;
343344
std::promise<string_type> version_promise;

‎boost/network/protocol/http/server/async_connection.hpp‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
#include<vector>
1414
#include<memory>
1515
#include<mutex>
16+
#include<array>
1617
#include<boost/asio/buffer.hpp>
1718
#include<boost/asio/ip/tcp.hpp>
1819
#include<boost/asio/strand.hpp>
@@ -287,7 +288,7 @@ struct async_connection
287288
}
288289

289290
private:
290-
typedefboost::array<char, BOOST_NETWORK_HTTP_SERVER_CONNECTION_BUFFER_SIZE>
291+
typedefstd::array<char, BOOST_NETWORK_HTTP_SERVER_CONNECTION_BUFFER_SIZE>
291292
buffer_type;
292293

293294
public:
@@ -344,7 +345,7 @@ struct async_connection
344345
if (ec) error_encountered = in_place<boost::system::system_error>(ec);
345346
}
346347

347-
typedefboost::array<char, BOOST_NETWORK_HTTP_SERVER_CONNECTION_BUFFER_SIZE>
348+
typedefstd::array<char, BOOST_NETWORK_HTTP_SERVER_CONNECTION_BUFFER_SIZE>
348349
array;
349350
typedef std::list<std::shared_ptr<array> > array_list;
350351
typedef std::shared_ptr<array_list> shared_array_list;

‎boost/network/protocol/http/server/sync_connection.hpp‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
#endif
1515

1616
#include<memory>
17+
#include<array>
1718
#include<boost/network/protocol/http/request_parser.hpp>
1819
#include<boost/network/protocol/http/request.hpp>
1920
#include<boost/network/protocol/http/response.hpp>
@@ -23,7 +24,6 @@
2324
#include<boost/asio/read.hpp>
2425
#include<boost/asio/strand.hpp>
2526
#include<boost/asio/placeholders.hpp>
26-
#include<boost/array.hpp>
2727
#include<boost/lexical_cast.hpp>
2828
#include<boost/algorithm/string/case_conv.hpp>
2929
#include<boost/bind.hpp>
@@ -215,7 +215,7 @@ struct sync_connection
215215
boost::asio::ip::tcp::socket socket_;
216216
boost::asio::io_service::strand wrapper_;
217217

218-
typedefboost::array<char, BOOST_NETWORK_HTTP_SERVER_CONNECTION_BUFFER_SIZE>
218+
typedefstd::array<char, BOOST_NETWORK_HTTP_SERVER_CONNECTION_BUFFER_SIZE>
219219
buffer_type;
220220
buffer_type buffer_;
221221
typedef basic_request_parser<Tag> request_parser;

‎libs/network/test/utils_base64_test.cpp‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,12 @@
33
#include<boost/test/unit_test.hpp>
44
#include<boost/network/utils/base64/encode.hpp>
55
#include<boost/network/utils/base64/encode-io.hpp>
6-
#include<boost/array.hpp>
76
#include<algorithm>
87
#include<iterator>
98
#include<string>
109
#include<vector>
1110
#include<sstream>
11+
#include<array>
1212

1313
usingnamespaceboost::network::utils;
1414

@@ -55,7 +55,7 @@ BOOST_AUTO_TEST_CASE(interface_test) {
5555
BOOST_CHECK_EQUAL(base64::encode<char>(char_array),"YWJj");
5656

5757
// check boost::array of chars
58-
boost::array<char,3> char_boost_array = {{'a','b','c'}};
58+
std::array<char,3> char_boost_array = {{'a','b','c'}};
5959

6060
BOOST_CHECK_EQUAL(base64::encode<char>(char_boost_array),"YWJj");
6161

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp