C++ Logo

std-proposals

Advanced search

Re: [std-proposals] Chimeric Pointer

From: Gergely Nagy <gergely.nagy.alt_at_[hidden]>
Date: Fri, 25 Nov 2022 20:16:29 +0100
The solution, while templated, syntactically very similar to what the OP
proposed.

On Fri, Nov 25, 2022, 20:09 Thiago Macieira via Std-Proposals <
std-proposals_at_[hidden]> wrote:

> On Friday, 25 November 2022 09:27:24 PST Gergely Nagy via Std-Proposals
> wrote:
> > Hey Thiago, have you checked my concept based solution above?
>
> I did. That's a separate solution but is still a template. TBH, I like
> yours
> more, but Frederick's request has merit too. I don't think it's enough to
> warrant a Standard Library feature, and thus definitely not for a Core
> Language
> one, but it can be solved within a regular library, such as wx itself. I
> just
> wanted to point out it is possible and, quite frankly, probably would be
> exactly as costly as the Standard feature would end up being.
>
> In particular, I don't buy the arguments against the template. You can
> avoid
> the problems with static members by moving them to non-template functions
> that
> get used in the template, offloading portions of the work based on the
> characteristics of the templated argument. That's where your concepts
> solution
> works.
>
> The other part is that accessing two base sub-objects that don't form a
> class
> itself indicates a design issue. If this use of a text entry and a control
> is
> common, the hierarchy should have been as suggested by Arthur:
>
> struct TextCtrl : Control, TextEntry {};
> struct TextCtrl1 : TextCtrl {}; // CHANGED!!
> struct TextCtrl2 : TextCtrl {}; // CHANGED!!
>
> And if it is not common, then I don't think we need a Standard feature for.
> --
> Thiago Macieira - thiago (AT) macieira.info - thiago (AT) kde.org
> Software Architect - Intel DCAI Cloud Engineering
>
>
>
> --
> Std-Proposals mailing list
> Std-Proposals_at_[hidden]
> https://lists.isocpp.org/mailman/listinfo.cgi/std-proposals
>

Received on 2022-11-25 19:16:46