C++ Logo

std-proposals

Advanced search

Re: [std-proposals] String Slicing Draft Proposal

From: Pavel Vazharov <freakpv_at_[hidden]>
Date: Thu, 14 Mar 2024 09:54:31 +0200
Hi there,

How are these two supposed to be distinguished by the compiler if the 3rd
parameter is defaulted.
  /* 1. */ basic_string_view basic_string::slice(size_t start, size_t end);
  /* 2. */ basic_string basic_string::slice(size_t start, size_t end,
size_t step = 1);

I mean, I don't see how the function overloading will work in this case.
const auto str = initial_str.slice(3, 5); // which of the above two is
called?

Regards,
Pavel.

On Thu, Mar 14, 2024 at 9:49 AM Rhidian De Wit via Std-Proposals <
std-proposals_at_[hidden]> wrote:

> Hi all,
>
> With some helpful suggestions, I'd like to present my draft proposal for
> the inclusion of several new utility functions to be added to
> *std::basic_string*.
>
> Please reach out if you have any questions, concerns or feedback!
>
> Sincerely,
>
> --
> Rhidian De Wit
> Software Engineer - Barco
> --
> Std-Proposals mailing list
> Std-Proposals_at_[hidden]
> https://lists.isocpp.org/mailman/listinfo.cgi/std-proposals
>

Received on 2024-03-14 07:54:43