File tree Expand file tree Collapse file tree 6 files changed +34
-11
lines changed Expand file tree Collapse file tree 6 files changed +34
-11
lines changed Original file line number Diff line number Diff line change 7
7
// http://www.boost.org/LICENSE_1_0.txt)
8
8
9
9
#include < memory>
10
+ #include < unordered_map>
10
11
#include < boost/asio/placeholders.hpp>
11
12
#include < boost/asio/strand.hpp>
12
13
#include < boost/network/protocol/http/traits/resolver.hpp>
13
14
#include < boost/network/traits/string.hpp>
14
- #include < boost/unordered/unordered_map.hpp>
15
15
#include < boost/function.hpp>
16
16
#include < boost/algorithm/string/case_conv.hpp>
17
17
#include < boost/lexical_cast.hpp>
@@ -31,7 +31,7 @@ struct async_resolver : std::enable_shared_from_this<async_resolver<Tag> > {
31
31
typedef std::pair<resolver_iterator, resolver_iterator>
32
32
resolver_iterator_pair;
33
33
typedef typename string<Tag>::type string_type;
34
- typedef boost ::unordered_map<string_type, resolver_iterator_pair>
34
+ typedef std ::unordered_map<string_type, resolver_iterator_pair>
35
35
endpoint_cache;
36
36
typedef boost::function<
37
37
void (boost::system::error_code const &, resolver_iterator_pair)>
Original file line number Diff line number Diff line change 8
8
// http://www.boost.org/LICENSE_1_0.txt)
9
9
10
10
#include < mutex>
11
+ #include < unordered_map>
11
12
#include < boost/algorithm/string/predicate.hpp>
12
13
#include < boost/network/protocol/http/client/connection/sync_base.hpp>
13
14
#include < boost/network/protocol/http/response.hpp>
14
15
#include < boost/network/protocol/http/traits/resolver_policy.hpp>
15
- #include < boost/unordered_map.hpp>
16
16
#include < utility>
17
17
18
18
#ifndef BOOST_NETWORK_HTTP_MAXIMUM_REDIRECT_COUNT
@@ -180,7 +180,7 @@ struct pooled_connection_policy : resolver_policy<Tag>::type {
180
180
181
181
typedef std::shared_ptr<connection_impl> connection_ptr;
182
182
183
- typedef unordered_map<string_type, std::weak_ptr<connection_impl>> host_connection_map;
183
+ typedef std:: unordered_map<string_type, std::weak_ptr<connection_impl>> host_connection_map;
184
184
std::mutex host_mutex_;
185
185
host_connection_map host_connections_;
186
186
bool follow_redirect_;
Original file line number Diff line number Diff line change 6
6
// (See accompanying file LICENSE_1_0.txt or copy at
7
7
// http://www.boost.org/LICENSE_1_0.txt)
8
8
9
+ #include < unordered_map>
9
10
#include < boost/network/protocol/http/traits/resolver.hpp>
10
11
#include < utility>
11
12
#include < boost/fusion/adapted/std_pair.hpp>
12
13
#include < boost/fusion/include/tuple.hpp>
13
14
#include < boost/algorithm/string/case_conv.hpp>
14
15
#include < boost/network/traits/string.hpp>
15
- #include < boost/unordered_map.hpp>
16
16
17
17
namespace boost {
18
18
namespace network {
@@ -30,7 +30,7 @@ struct sync_resolver {
30
30
31
31
protected:
32
32
typedef typename string<Tag>::type string_type;
33
- typedef boost ::unordered_map<string_type, resolver_iterator_pair>
33
+ typedef std ::unordered_map<string_type, resolver_iterator_pair>
34
34
resolved_cache;
35
35
resolved_cache endpoint_cache_;
36
36
bool cache_resolved_;
Original file line number Diff line number Diff line change 10
10
#pragma once
11
11
12
12
#include < iterator>
13
+ #include < functional>
13
14
#include < boost/network/uri/config.hpp>
14
15
#include < boost/network/uri/detail/uri_parts.hpp>
15
16
#include < boost/network/uri/schemes.hpp>
@@ -297,7 +298,29 @@ inline std::size_t hash_value(const uri &uri_) {
297
298
}
298
299
return seed;
299
300
}
301
+ } // namespace uri
302
+ } // namespace network
303
+ } // namespace boost
304
+
305
+ namespace std {
306
+ template <>
307
+ struct hash <boost::network::uri::uri> {
308
+
309
+ std::size_t operator ()(const boost::network::uri::uri &uri_) const {
310
+ std::size_t seed = 0 ;
311
+ std::for_each (std::begin (uri_), std::end (uri_),
312
+ [&seed](boost::network::uri::uri::value_type v) {
313
+ std::hash<boost::network::uri::uri::value_type> hasher;
314
+ seed ^= hasher (v) + 0x9e3779b9 + (seed << 6 ) + (seed >> 2 );
315
+ });
316
+ return seed;
317
+ }
318
+ };
319
+ } // namespace std
300
320
321
+ namespace boost {
322
+ namespace network {
323
+ namespace uri {
301
324
inline bool operator ==(const uri &lhs, const uri &rhs) {
302
325
return boost::equal (lhs, rhs);
303
326
}
Original file line number Diff line number Diff line change 3
3
// (See accompanying file LICENSE_1_0.txt or copy at
4
4
// http://www.boost.org/LICENSE_1_0.txt)
5
5
6
+ #include < unordered_set>
6
7
#include < boost/network/uri/schemes.hpp>
7
- #include < boost/unordered_set.hpp>
8
8
9
9
namespace boost {
10
10
namespace network {
11
11
namespace uri {
12
12
namespace {
13
- static boost ::unordered_set<std::string> hierarchical_schemes_;
14
- static boost ::unordered_set<std::string> opaque_schemes_;
13
+ static std ::unordered_set<std::string> hierarchical_schemes_;
14
+ static std ::unordered_set<std::string> opaque_schemes_;
15
15
16
16
bool register_hierarchical_schemes () {
17
17
hierarchical_schemes_.insert (" http" );
Original file line number Diff line number Diff line change 14
14
#include < memory>
15
15
#include < map>
16
16
#include < set>
17
- #include < boost/ unordered_set.hpp >
17
+ #include < unordered_set>
18
18
19
19
using namespace boost ::network;
20
20
@@ -530,7 +530,7 @@ TEST(URITest, uri_set_test) {
530
530
}
531
531
532
532
TEST (URITest, uri_unordered_set_test) {
533
- boost ::unordered_set<uri::uri> uri_set;
533
+ std ::unordered_set<uri::uri> uri_set;
534
534
uri_set.insert (uri::uri (" http://www.example.com/" ));
535
535
ASSERT_TRUE (!uri_set.empty ());
536
536
EXPECT_EQ (uri::uri (" http://www.example.com/" ), (*uri_set.begin ()));
You can’t perform that action at this time.
0 commit comments