Then why not call the respective f() functions from the constructors?
-----Ursprüngliche Nachricht-----
Von: Rainer Deyke via Std-Proposals <std-proposals@lists.isocpp.org>
Gesendet: Mi 01.07.2026 08:26
Betreff: Re: [std-proposals] c++ proposal
An: std-proposals@lists.isocpp.org;
CC: Rainer Deyke <rainerd@eldwood.com>;
On 7/1/26 08:12, Sebastian Wittmeier via Std-Proposals wrote:
> Making f() virtual is a bit confusing:
>
>
> During construction only the base member function is called. So it could be non-virtual as well?
Making f() virtual is the whole point of the example. When called from
base::base, base::init calls base::f. When called from
derived1::dervived1, base::init calls derived1::f. When called from
derived2::dervived2, base::init calls derived2::f.
--
Rainer Deyke - rainerd@eldwood.com
--
Std-Proposals mailing list
Std-Proposals@lists.isocpp.org
https://lists.isocpp.org/mailman/listinfo.cgi/std-proposals