C++ Logo

std-proposals

Advanced search

Re: Allow virtual base classes in constexpr

From: Jake Arkinstall <jake.arkinstall_at_[hidden]>
Date: Sat, 1 Jun 2019 03:33:14 +0100
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.

Received on 2019-05-31 21:35:09