From 49e21a8fea5ca1ddbfed0817745adcc6ef46a780 Mon Sep 17 00:00:00 2001 From: Teddy Reed Date: Fri, 17 Feb 2017 09:54:58 -0800 Subject: [PATCH] boost: Use make_optional for boost 1.63 --- .../network/protocol/http/client/options.hpp | 12 ++++---- .../protocol/http/message/async_message.hpp | 2 +- boost/network/uri/detail/uri_parts.hpp | 28 +++++++++---------- 3 files changed, 21 insertions(+), 21 deletions(-) diff --git a/boost/network/protocol/http/client/options.hpp b/boost/network/protocol/http/client/options.hpp index 2c109a88d..270ed5b50 100644 --- a/boost/network/protocol/http/client/options.hpp +++ b/boost/network/protocol/http/client/options.hpp @@ -91,39 +91,39 @@ class client_options { /// Set the filename of the certificate to load for the SSL connection for /// verification. client_options& openssl_certificate(string_type const& v) { - openssl_certificate_ = v; + openssl_certificate_ = make_optional(v); return *this; } /// Set the directory for which the certificate authority files are located. client_options& openssl_verify_path(string_type const& v) { - openssl_verify_path_ = v; + openssl_verify_path_ = make_optional(v); return *this; } /// Set the filename of the certificate to use for client-side SSL session /// establishment. client_options& openssl_certificate_file(string_type const& v) { - openssl_certificate_file_ = v; + openssl_certificate_file_ = make_optional(v); return *this; } /// Set the filename of the private key to use for client-side SSL session /// establishment. client_options& openssl_private_key_file(string_type const& v) { - openssl_private_key_file_ = v; + openssl_private_key_file_ = make_optional(v); return *this; } /// Set the ciphers to support for SSL negotiation. client_options& openssl_ciphers(string_type const& v) { - openssl_ciphers_ = v; + openssl_ciphers_ = make_optional(v); return *this; } /// Set the hostname for SSL SNI hostname support. client_options& openssl_sni_hostname(string_type const& v) { - openssl_sni_hostname_ = v; + openssl_sni_hostname_ = make_optional(v); return *this; } diff --git a/boost/network/protocol/http/message/async_message.hpp b/boost/network/protocol/http/message/async_message.hpp index bca9148b2..3b001283c 100644 --- a/boost/network/protocol/http/message/async_message.hpp +++ b/boost/network/protocol/http/message/async_message.hpp @@ -91,7 +91,7 @@ struct async_message { for (string_type const & key : removed_headers) { raw_headers.erase(key); } - retrieved_headers_ = raw_headers; + retrieved_headers_ = make_optional(raw_headers); return *retrieved_headers_; } diff --git a/boost/network/uri/detail/uri_parts.hpp b/boost/network/uri/detail/uri_parts.hpp index e250396c6..3fcfe99ae 100644 --- a/boost/network/uri/detail/uri_parts.hpp +++ b/boost/network/uri/detail/uri_parts.hpp @@ -29,27 +29,27 @@ struct hierarchical_part { void update() { if (!user_info) { if (host) { - user_info = iterator_range(std::begin(host.get()), - std::begin(host.get())); + user_info = make_optional(iterator_range(std::begin(host.get()), + std::begin(host.get()))); } else if (path) { - user_info = iterator_range(std::begin(path.get()), - std::begin(path.get())); + user_info = make_optional(iterator_range(std::begin(path.get()), + std::begin(path.get()))); } } if (!host) { - host = iterator_range(std::begin(path.get()), - std::begin(path.get())); + host = make_optional(iterator_range(std::begin(path.get()), + std::begin(path.get()))); } if (!port) { - port = iterator_range(std::end(host.get()), - std::end(host.get())); + port = make_optional(iterator_range(std::end(host.get()), + std::end(host.get()))); } if (!path) { - path = iterator_range(std::end(port.get()), - std::end(port.get())); + path = make_optional(iterator_range(std::end(port.get()), + std::end(port.get()))); } } }; @@ -70,13 +70,13 @@ struct uri_parts { hier_part.update(); if (!query) { - query = iterator_range(std::end(hier_part.path.get()), - std::end(hier_part.path.get())); + query = make_optional(iterator_range(std::end(hier_part.path.get()), + std::end(hier_part.path.get()))); } if (!fragment) { - fragment = iterator_range(std::end(query.get()), - std::end(query.get())); + fragment = make_optional(iterator_range(std::end(query.get()), + std::end(query.get()))); } } };