// address_v6.cpp
// ~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2016 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2017 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// Distributed under the Boost Software License, Version 1.0. (See accompanying
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
b = addr1.is_v4_mapped();
(void)b;
+#if !defined(BOOST_ASIO_NO_DEPRECATED)
b = addr1.is_v4_compatible();
(void)b;
+#endif // !defined(BOOST_ASIO_NO_DEPRECATED)
b = addr1.is_multicast_node_local();
(void)b;
(void)bytes_value;
std::string string_value = addr1.to_string();
+#if !defined(BOOST_ASIO_NO_DEPRECATED)
string_value = addr1.to_string(ec);
+#endif // !defined(BOOST_ASIO_NO_DEPRECATED)
+#if !defined(BOOST_ASIO_NO_DEPRECATED)
ip::address_v4 addr3 = addr1.to_v4();
+#endif // !defined(BOOST_ASIO_NO_DEPRECATED)
// address_v6 static functions.
+#if !defined(BOOST_ASIO_NO_DEPRECATED)
addr1 = ip::address_v6::from_string("0::0");
addr1 = ip::address_v6::from_string("0::0", ec);
addr1 = ip::address_v6::from_string(string_value);
addr1 = ip::address_v6::from_string(string_value, ec);
+#endif // !defined(BOOST_ASIO_NO_DEPRECATED)
addr1 = ip::address_v6::any();
addr1 = ip::address_v6::loopback();
+#if !defined(BOOST_ASIO_NO_DEPRECATED)
addr1 = ip::address_v6::v4_mapped(addr3);
addr1 = ip::address_v6::v4_compatible(addr3);
+#endif // !defined(BOOST_ASIO_NO_DEPRECATED)
// address_v6 comparisons.
b = (addr1 >= addr2);
(void)b;
+ // address_v6 creation functions.
+
+ addr1 = ip::make_address_v6(const_bytes_value, scope_id);
+ addr1 = ip::make_address_v6("0::0");
+ addr1 = ip::make_address_v6("0::0", ec);
+ addr1 = ip::make_address_v6(string_value);
+ addr1 = ip::make_address_v6(string_value, ec);
+#if defined(BOOST_ASIO_HAS_STD_STRING_VIEW)
+# if defined(BOOST_ASIO_HAS_STD_EXPERIMENTAL_STRING_VIEW)
+ std::experimental::string_view string_view_value("0::0");
+# else // defined(BOOST_ASIO_HAS_STD_EXPERIMENTAL_STRING_VIEW)
+ std::string_view string_view_value("0::0");
+# endif // defined(BOOST_ASIO_HAS_STD_EXPERIMENTAL_STRING_VIEW)
+ addr1 = ip::make_address_v6(string_view_value);
+ addr1 = ip::make_address_v6(string_view_value, ec);
+#endif // defined(BOOST_ASIO_HAS_STD_STRING_VIEW)
+
+ // address_v6 IPv4-mapped conversion.
+#if defined(BOOST_ASIO_NO_DEPRECATED)
+ ip::address_v4 addr3;
+#endif // defined(BOOST_ASIO_NO_DEPRECATED)
+ addr1 = ip::make_address_v6(ip::v4_mapped, addr3);
+ addr3 = ip::make_address_v4(ip::v4_mapped, addr1);
+
// address_v6 I/O.
std::ostringstream os;
BOOST_ASIO_CHECK(!mcast_org_local_address.is_v4_mapped());
BOOST_ASIO_CHECK(!mcast_site_local_address.is_v4_mapped());
+#if !defined(BOOST_ASIO_NO_DEPRECATED)
BOOST_ASIO_CHECK(!unspecified_address.is_v4_compatible());
BOOST_ASIO_CHECK(!loopback_address.is_v4_compatible());
BOOST_ASIO_CHECK(!link_local_address.is_v4_compatible());
BOOST_ASIO_CHECK(!mcast_node_local_address.is_v4_compatible());
BOOST_ASIO_CHECK(!mcast_org_local_address.is_v4_compatible());
BOOST_ASIO_CHECK(!mcast_site_local_address.is_v4_compatible());
+#endif // !defined(BOOST_ASIO_NO_DEPRECATED)
BOOST_ASIO_CHECK(!unspecified_address.is_multicast());
BOOST_ASIO_CHECK(!loopback_address.is_multicast());