8 auto is_private(std::string_view addr
) -> bool;
9 auto is_address(std::string_view addr
) -> bool;
10 auto is_address_literal(std::string_view addr
) -> bool;
11 auto to_address_literal(std::string_view addr
) -> std::string
;
12 auto reverse(std::string_view addr
) -> std::string
;
14 constexpr char lit_pfx
[] = "[IPv6:";
15 constexpr auto lit_pfx_sz
{sizeof(lit_pfx
) - 1};
17 constexpr char lit_sfx
[] = "]";
18 constexpr auto lit_sfx_sz
{sizeof(lit_sfx
) - 1};
20 constexpr auto lit_extra_sz
{lit_pfx_sz
+ lit_sfx_sz
};
22 constexpr auto loopback_literal
{"[IPv6:::1]"};
24 constexpr auto as_address(std::string_view address_literal
) -> std::string_view
26 // CHECK(is_address_literal(address_literal));
27 return std::string_view(begin(address_literal
) + lit_pfx_sz
,
28 size(address_literal
) - lit_extra_sz
);