Why can't virtual functions use return type deduction?
问题 n3797 says: § 7.1.6.4/14: A function declared with a return type that uses a placeholder type shall not be virtual (10.3). Therefore the following program is ill-formed: struct s { virtual auto foo() { } }; All I can find for the rationale is this vague one-liner from n3638: virtual It would be possible to allow return type deduction for virtual functions, but that would complicate both override checking and vtable layout, so it seems preferable to prohibit this. Can anyone provide further