|
Boost : |
From: Gavin Lambert (boost_at_[hidden])
Date: 2022-08-22 23:58:16
On 23/08/2022 08:14, Vinnie Falco wrote:
> Hmm yeah I see what you mean. I didn't think of this - that's why
> field experience is so vital. The reason they return url_base& is
> because that's the class that has all the mutation logic. This is
> shared between `url` and `static_url`. To get functions like
> `set_host` to return `url&` instead would be challenging. We would
> have to put a copy of the entire set of mutating API member function
> signatures into both `url` and `static_url_base` and have those return
> the correct type.
Another option (not necessarily a better one) is to make url_base (or
whatever provides those methods, if moved) use CRTP.
This could potentially even be just a thin wrapper around private
implementation that still uses a concrete base internally, at the cost
of a slightly dodgy downcast in the wrapper.
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk