220 38049 <2854927.TkF46kRZde@tjmaciei-mobl1> article
Path: news.gmane.org!.POSTED!not-for-mail
From: Thiago Macieira <thiago@macieira.org>
Newsgroups: gmane.comp.lang.c++.isocpp.proposals
Subject: Re: Re: Hide inherited virtual methods (on demand)
 instead of trying to override them.
Date: Mon, 07 May 2018 19:55:11 -0700
Lines: 26
Approved: news@gmane.org
Message-ID: <2854927.TkF46kRZde@tjmaciei-mobl1>
References: <42a958cd-431a-48b5-b725-9793e210deff@isocpp.org> <c41fe2fc-5910-4c76-b0e0-065fa160d552@isocpp.org>
Reply-To: std-proposals@isocpp.org
NNTP-Posting-Host: blaine.gmane.org
Mime-Version: 1.0
Content-Type: text/plain; charset="UTF-8"
X-Trace: blaine.gmane.org 1525747992 9044 195.159.176.226 (8 May 2018 02:53:12 GMT)
X-Complaints-To: usenet@blaine.gmane.org
NNTP-Posting-Date: Tue, 8 May 2018 02:53:12 +0000 (UTC)
To: std-proposals@isocpp.org
Original-X-From: std-proposals+bncBCB4TK757YBRBE5DYTLQKGQE2E7T7RI@isocpp.org Tue May 08 04:53:08 2018
Return-path: <std-proposals+bncBCB4TK757YBRBE5DYTLQKGQE2E7T7RI@isocpp.org>
Envelope-to: gclcip-std-proposals@m.gmane.org
Original-Received: from mail-qk0-f200.google.com ([209.85.220.200])
	by blaine.gmane.org with esmtp (Exim 4.84_2)
	(envelope-from <std-proposals+bncBCB4TK757YBRBE5DYTLQKGQE2E7T7RI@isocpp.org>)
	id 1fFskT-0002E7-AM
	for gclcip-std-proposals@m.gmane.org; Tue, 08 May 2018 04:53:05 +0200
Original-Received: by mail-qk0-f200.google.com with SMTP id d11sf22799354qkg.20
        for <gclcip-std-proposals@m.gmane.org>; Mon, 07 May 2018 19:55:16 -0700 (PDT)
ARC-Seal: i=2; a=rsa-sha256; t=1525748116; cv=pass;
        d=google.com; s=arc-20160816;
        b=twH13KJt2MFoJTzIvpovLZ3YQWrQq78teVdTnh1TrvAN9Fuzb9L69KDRATqYu8lxsV
         2Lh0QisMiSrqnO84MewTJBzM20PWwT5f03jOVMDBf3i/uG1sD/s4DpdxT/HQzMllAiXg
         fZkcDhLtPYNlzYUW9WDHN9VY/WYiZQEO8AyiUDCynclFBGfiNLIyqrPgYSxWj1sC75Jm
         8VXJVjFsuIY8umGsElizCDo1Aze2Zz6zgs6Vxa/433H1uvsLg8hFWXxPA0XLjleffAfr
         /FqnEoGtcVDuYzsX2ma5cQzCH+upLey61xqL8GneLAFRrDzcqpCsSo5ZDZM/yKP3BNEu
         faiA==
ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816;
        h=list-unsubscribe:list-subscribe:list-archive:list-help:list-post
         :list-id:mailing-list:precedence:reply-to:mime-version:references
         :in-reply-to:message-id:date:subject:to:from
         :arc-authentication-results:arc-message-signature:dkim-signature
         :arc-authentication-results;
        bh=AVVkUCJ0SiEhea71eUEjTMApMbA+IaRv9b4gT95c3pE=;
        b=Gs5rHI/aeExibGHfFJTAz6rMWFwd8GL+tATeR92klLOQwv3ITie9KEYz9b1Wun5GSi
         X/V0nWXRZlVbqY0BM5XEPQL5iDlkv76oPikt7WAlUK7cVg27MwFgVXXR0vtthBajPd3b
         wGEo4w0LYPS8VS8mN6eixTkLK+XwKPqTeqgtlTKYIWPpRayE2A0YEmNvvYFSN1QDYOUX
         CcE1fLnQ0p7YcT0ODbHm4CxQeqvSI1EC/qi7hSouksWEH3ms+4tsT7si1nm4GSgS6EUN
         8ivIaQ2cs6ET840P39bM9mz21MGvbARd9QB1AnOTi82yix20Lr2DbB0fuS8nzGO+nMCz
         6kxQ==
ARC-Authentication-Results: i=2; mx.google.com;
       spf=pass (google.com: domain of thiago@macieira.org designates 2001:19f0:5:2221::1:3 as permitted sender) smtp.mailfrom=thiago@macieira.org
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=isocpp-org.20150623.gappssmtp.com; s=20150623;
        h=from:to:subject:date:message-id:in-reply-to:references:mime-version
         :x-original-sender:x-original-authentication-results:reply-to
         :precedence:mailing-list:list-id:list-post:list-help:list-archive
         :list-subscribe:list-unsubscribe;
        bh=AVVkUCJ0SiEhea71eUEjTMApMbA+IaRv9b4gT95c3pE=;
        b=Jz5WNAcRKjZPCh6RodLSdUq5QUKLTEQqub7CxU6Z+mvcCQEm/UXeJ/uFpyGx4HtFhL
         YVOvxr43K1y8XTP8GfQvWwgjdvlp7St4YPg5XkoRoh7xKnIRWrxPXidtMIuc2cRmE7DC
         zL7+80TEzJBKrWgv4O3iuvAGFdhQGyCbpEsF7+M32YoQMNB3Qr+Vg+wSUYq5Oi2vPtH1
         5V4nA/XPaUiv3H1az763WStScN8DV4kjjD9kBZLDFmbZ+4mg7dJ/25r27poLNKm6bBms
         B578XRIuLPMPub288LlkcKgm/1sY/Dpzb83i6Zcs3JaYYDwNAiqgfdoZmQkACjdMKrvN
         p/Zg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20161025;
        h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to
         :references:mime-version:x-original-sender
         :x-original-authentication-results:reply-to:precedence:mailing-list
         :list-id:x-spam-checked-in-group:list-post:list-help:list-archive
         :list-subscribe:list-unsubscribe;
        bh=AVVkUCJ0SiEhea71eUEjTMApMbA+IaRv9b4gT95c3pE=;
        b=XLu2Ehz+Y08wyGFdq8HTAj6SWnoVG6C/egOIuLM0OO4nNfMakwf+9Rula3e0md4oOI
         UCeq2fAma7IKpbA2fTYwB/tKvQ6LzpvKTcyHnDf1EIIP7DcmR63393Tw136oTU3PNe+2
         JhKkHKknl7akn0sGmdzeFuVq93t1TpVX6Dm3T1A7760E4NleEfom1arFYuLwZscYDQEp
         5dCm3CeSxV901Hi4MTfwHivKlPHhq7K3QHtjoD4eGthGK5+BbOc1XqrtcEQ9xaFVims0
         qBnbYhPu5Bnd3TGsAO17z/7VWbEeVz5cFXgKgAQw8guJOAPrtokgzgxVWTbzRxiM5Jyd
         +o+A==
X-Gm-Message-State: ALKqPwc9smNx/M4OcmDJx7jVaJnntVH5FXPfnQajRRdTPRdmm+/7jktL
	YHT9crO6yH3CMDp/ZLK2WOkl1g==
X-Google-Smtp-Source: AB8JxZoOvCXE2C4SVkus8MLrzmZniY+pWO8GhtISuRQUcnGoqMYhzGGJe1WaPkEYEpO2dC9W3cwOGw==
X-Received: by 10.55.200.11 with SMTP id c11mr9937382qkj.34.1525748116098;
        Mon, 07 May 2018 19:55:16 -0700 (PDT)
X-BeenThere: std-proposals@isocpp.org
Original-Received: by 10.55.72.86 with SMTP id v83ls10484156qka.5.gmail; Mon, 07 May
 2018 19:55:15 -0700 (PDT)
X-Received: by 10.55.177.129 with SMTP id a123mr31619065qkf.419.1525748115117;
        Mon, 07 May 2018 19:55:15 -0700 (PDT)
ARC-Seal: i=1; a=rsa-sha256; t=1525748115; cv=none;
        d=google.com; s=arc-20160816;
        b=Pl1gB20ud9+Xi2OXNVFNFAgRiJPvLqIm1TmCR1qocm8WCKjjah7cVds8M6zq5e0vBr
         p/h0npeliZ/DeYEkDrsvJ7v4T4ONkB7oWMhpcY01ncYDBQDonklxvxwRtdffsETwQ73z
         h/zTsub0+yIdF7BFE0OiwNtv/3wFvgJdX0cJL4jr7uKKMafbNbjNMxBcH1/KV1ba9ubx
         EASXw9oGSeptXSAjyPXfC+WHJkoD6Tfp0rfoN/GLvyuy/sZFp80BHnaJulEnOj6PId4R
         IjF/bhARigbVRjYbi52R/WXEQT2WHq9TvAu1zchYbZKl6DrYp2r+iUg1d+ZR0G41dZ3R
         Hi1A==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816;
        h=content-transfer-encoding:mime-version:references:in-reply-to
         :message-id:date:subject:to:from:arc-authentication-results;
        bh=iBZn58LtBI2SKqZHIcyPTSqmIFm3dSC0i5lLqZDT2Sk=;
        b=0mQfp9Um7IaTbsh/gdVbitO7jklCwdCRvL3Vv1VunRhLn/vyMviQsrc1r69rWgXImW
         p22GUkpSKkzF7UZmF0fn70pSOKIoOh/hNZ5MN4qCEKNc8YE/CjNtThZXLx2qtrenyMGH
         LOgFhtgQwBQHPWAecGU5v6GLrqjDCFy5N3nikoX5k5WDsdhYc07B1TdaXw+4IqeSgUii
         SRDHLblqZjXLTIvpJKw8N+EP0TFPNkbRU70O5eEt8EZ1RceoAj94tK2nNmHdIxKhaoe8
         UXmE8fIbOEox5ajOZnlOXZzfpCCOz0UWZMVPVVeUCoCGAnBGLdV8VC9jH/ytDBC43LID
         f0vg==
ARC-Authentication-Results: i=1; mx.google.com;
       spf=pass (google.com: domain of thiago@macieira.org designates 2001:19f0:5:2221::1:3 as permitted sender) smtp.mailfrom=thiago@macieira.org
Original-Received: from smtp.macieira.info (smtp.macieira.info. [2001:19f0:5:2221::1:3])
        by mx.google.com with ESMTPS id x40-v6si1702090qtb.244.2018.05.07.19.55.14
        for <std-proposals@isocpp.org>
        (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);
        Mon, 07 May 2018 19:55:14 -0700 (PDT)
Received-SPF: pass (google.com: domain of thiago@macieira.org designates 2001:19f0:5:2221::1:3 as permitted sender) client-ip=2001:19f0:5:2221::1:3;
Original-Received: from tjmaciei-mobl1.localnet (unknown [IPv6:2601:1c0:4501:5f9f:a814:ba14:3a0e:a3f6])
	by smtp.macieira.info (Postfix) with ESMTPSA id 58062DDA1
	for <std-proposals@isocpp.org>; Mon,  7 May 2018 19:55:13 -0700 (PDT)
In-Reply-To: <c41fe2fc-5910-4c76-b0e0-065fa160d552@isocpp.org>
X-Original-Sender: thiago@macieira.org
X-Original-Authentication-Results: mx.google.com;       spf=pass (google.com:
 domain of thiago@macieira.org designates 2001:19f0:5:2221::1:3 as permitted
 sender) smtp.mailfrom=thiago@macieira.org
Precedence: list
Mailing-list: list std-proposals@isocpp.org; contact std-proposals+owners@isocpp.org
List-ID: <std-proposals.isocpp.org>
X-Spam-Checked-In-Group: std-proposals@isocpp.org
X-Google-Group-Id: 399137483710
List-Post: <https://groups.google.com/a/isocpp.org/group/std-proposals/post>, <mailto:std-proposals@isocpp.org>
List-Help: <https://support.google.com/a/isocpp.org/bin/topic.py?topic=25838>, <mailto:std-proposals+help@isocpp.org>
List-Archive: <https://groups.google.com/a/isocpp.org/group/std-proposals/>
List-Subscribe: <https://groups.google.com/a/isocpp.org/group/std-proposals/subscribe>,
 <mailto:std-proposals+subscribe@isocpp.org>
List-Unsubscribe: <mailto:googlegroups-manage+399137483710+unsubscribe@googlegroups.com>,
 <https://groups.google.com/a/isocpp.org/group/std-proposals/subscribe>
Xref: news.gmane.org gmane.comp.lang.c++.isocpp.proposals:38049
Archived-At: <http://permalink.gmane.org/gmane.comp.lang.c++.isocpp.proposals/38049>

On segunda-feira, 7 de maio de 2018 18:53:33 PDT Jared Grubb wrote:
> You are describing something like "co-variant return types", which works
> for primitive types (https://godbolt.org/g/ra5rhy), but it doesn't work for
> user-defined types (even shared_ptr) at all.

Note that the proposal would *not* be a covariant override.

In a covariant override, the override returns a new type but you can still 
call the base implementation and the language will adjust pointers as 
necessary to make the caller get the right object. This new override / 
overload does not do that. 

The proposal needs amending if this is one of the target use-cases.

-- 
Thiago Macieira - thiago (AT) macieira.info - thiago (AT) kde.org
   Software Architect - Intel Open Source Technology Center



-- 
You received this message because you are subscribed to the Google Groups "ISO C++ Standard - Future Proposals" group.
To unsubscribe from this group and stop receiving emails from it, send an email to std-proposals+unsubscribe@isocpp.org.
To post to this group, send email to std-proposals@isocpp.org.
To view this discussion on the web visit https://groups.google.com/a/isocpp.org/d/msgid/std-proposals/2854927.TkF46kRZde%40tjmaciei-mobl1.

.
