C++ Logo

std-proposals

Advanced search

Re: [std-proposals] resolving function overloading ambiguity for bool arguments

From: Sebastian Wittmeier <wittmeier_at_[hidden]>
Date: Sun, 11 Jan 2026 11:36:44 +0100
And those instructions appear before including headers with templates or inline functions? Which then stop to work as designed? Then better get a compile error, when an implicit conversion (only those which were disabled) would happen. Those global changes of language defaults better fit into (safety) profiles.   -----Ursprüngliche Nachricht----- Von:Robert J. Simpson via Std-Proposals <std-proposals_at_[hidden]> Gesendet:So 11.01.2026 10:43 Betreff:Re: [std-proposals] resolving function overloading ambiguity for bool arguments An:std-proposals_at_[hidden]; CC:Robert J. Simpson <robert.simpson.lists_at_[hidden]>; Wouldn't it be better to be able to disable implicit conversion completely? E.g. by declaring explicit bool (int); explicit bool (false); etc. Rob   On 09/01/2026 16:37, Steve Weinrich via Std-Proposals wrote: Consider two methods:   void interest (double arg1, bool minor); void interest (double arg1, int factor);   The call: interest(5.5, 5); is ambiguous because 5 will freely convert to a bool.    I was wondering what y’all would think of narrowing this behavior by this addition:   void interest (double arg1, explicit bool minor);   Potentially, this could be applied to all arguments:   void explicit interest (double arg1, bool minor);   Thanks, Steve -- Std-Proposals mailing list Std-Proposals_at_[hidden] https://lists.isocpp.org/mailman/listinfo.cgi/std-proposals

Received on 2026-01-11 10:52:35