[Development] QList

Thiago Macieira thiago.macieira at intel.com
Thu Mar 23 20:57:44 CET 2017


On quinta-feira, 23 de março de 2017 11:33:37 PDT Ville Voutilainen wrote:
> On 23 March 2017 at 20:27, Thiago Macieira <thiago.macieira at intel.com> 
wrote:
> > In the mean time: why do you care if some class derives from QStringView?
> > We certainly need to discuss the presence of an extra pointer inside, as
> > that has a cost. But derivation?
> 
> A base class that a user can name is detectable in multiple
> inheritance scenarios.
> Once you add such a base, it becomes hard to remove it, regardless of its
> size.

True, but remember I am proposing as a private base, so it's not exposed to 
others.

Do you mean this:

struct View { };
struct String : private View { };

struct UserCode : public String, public View {};
// warning: direct base 'View' inaccessible in 'UserCode' due to ambiguity

https://godbolt.org/g/TsFS4l

-- 
Thiago Macieira - thiago.macieira (AT) intel.com
  Software Architect - Intel Open Source Technology Center




More information about the Development mailing list