C++ Logo

STD-PROPOSALS

Advanced search

Subject: Re: [std-proposals] Allow virtual base classes in constexpr
From: Jake Arkinstall (jake.arkinstall_at_[hidden])
Date: 2019-05-31 21:33:14


Immediate thought: this doesn't make sense to me. Can you provide a more
detailed description of your particular use case? If it is just the
inheritance of the I/O child classes then CRTP is the canonical solution.
At least that way the type of the child class is known by the compiler,
whereas the entire point of virtual inheritance is to allow flexibility at
runtime.

As such, I don't think this is remotely possible apart from in the
circumstances that only one type is possible (E.g. in a branch where the
type is determined). If those circumstances are commonplace, virtual
inheritance is likely avoidable.



STD-PROPOSALS list run by herb.sutter at gmail.com

Standard Proposals Archives on Google Groups