|
Boost : |
From: Rainer Deyke (rdeyke_at_[hidden])
Date: 2021-10-15 16:03:15
On 15.10.21 17:13, Vinnie Falco via Boost wrote:
> How would you convert this code to use "safer parse_url(str)"?
>
> url_view u1 = parse_relative_ref( "/" ).value();
> url u2 = parse_relative_ref( "/" ).value();
> static_url<1024> u3 = parse_relative_ref( "/" ).value();
> pmr_url u4 = parse_relative_ref( "/" ).value();
> dynamic_url<
> std::allocator<char>> u5 = parse_relative_ref( "/" ).value();
The following would do the trick:
auto u1 = parse_relative_ref<url_view>( "/" ).value();
auto u2 = parse_relative_ref<url>( "/" ).value();
auto u3 = parse_relative_ref<static_url<1024>>( "/" ).value();
auto u4 = parse_relative_ref<pmr_url>( "/" ).value();
auto u5 = parse_relative_ref<dynamic_url<
std::allocator<char>>>( "/" ).value();
-- Rainer Deyke (rainerd_at_[hidden])
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk