>> An alternative solution might be named arguments.

or tags, e.g. for 

Complex(T r, T i, complex_t);
Complex(T angle, T radius, complex_angle t);

however this means completely changing the container API...


On Thu, Jul 23, 2020 at 10:55 AM Olaf van der Spek via Std-Proposals <std-proposals@lists.isocpp.org> wrote:
On Wed, Jul 22, 2020 at 7:51 PM Scott Michaud via Std-Proposals
<std-proposals@lists.isocpp.org> wrote:
> Do the library maintainers have any established opinion about strongly typing parameters that can be ambiguous?
>
> I'll illustrate what I mean with a concrete use case: std::vector.
>
> In C++, there is a constructor that takes a single size_type and creates a vector with n default-constructed elements. I need to frequently bounce between languages, and other languages (such as Java and C#) have their analogous constructor initialize the capacity without creating initial elements. This makes it difficult to remember how any given language's standard library behaves.

An alternative solution might be named arguments.

--
Olaf
--
Std-Proposals mailing list
Std-Proposals@lists.isocpp.org
https://lists.isocpp.org/mailman/listinfo.cgi/std-proposals