220 1448 <738f626c-3b23-4c74-9eea-2c2246921a81@isocpp.org> article
Path: news.gmane.org!not-for-mail
From: Arthur Tchaikovsky <atch.cpp@gmail.com>
Newsgroups: gmane.comp.lang.c++.isocpp.proposals
Subject: making using declaration more precise
Date: Sat, 5 Jan 2013 10:07:03 -0800 (PST)
Lines: 89
Approved: news@gmane.org
Message-ID: <738f626c-3b23-4c74-9eea-2c2246921a81@isocpp.org>
Reply-To: std-proposals@isocpp.org
NNTP-Posting-Host: plane.gmane.org
Mime-Version: 1.0
Content-Type: multipart/alternative; 
	boundary="----=_Part_1718_9219898.1357409223686"
X-Trace: ger.gmane.org 1357409228 21253 80.91.229.3 (5 Jan 2013 18:07:08 GMT)
X-Complaints-To: usenet@ger.gmane.org
NNTP-Posting-Date: Sat, 5 Jan 2013 18:07:08 +0000 (UTC)
To: std-proposals@isocpp.org
Original-X-From: std-proposals+bncBDL6FI4NYYERBSWXUGDQKGQE46JWWOY@isocpp.org Sat Jan 05 19:07:25 2013
Return-path: <std-proposals+bncBDL6FI4NYYERBSWXUGDQKGQE46JWWOY@isocpp.org>
Envelope-to: gclcip-std-proposals@m.gmane.org
Original-Received: from mail-vb0-f69.google.com ([209.85.212.69])
	by plane.gmane.org with esmtp (Exim 4.69)
	(envelope-from <std-proposals+bncBDL6FI4NYYERBSWXUGDQKGQE46JWWOY@isocpp.org>)
	id 1TrY9S-0004lR-Vx
	for gclcip-std-proposals@m.gmane.org; Sat, 05 Jan 2013 19:07:23 +0100
Original-Received: by mail-vb0-f69.google.com with SMTP id ff20sf26886871vbb.8
        for <gclcip-std-proposals@m.gmane.org>; Sat, 05 Jan 2013 10:07:07 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20120113;
        h=x-received:x-beenthere:x-received:date:from:to:message-id:subject
         :mime-version:x-original-sender:reply-to:precedence:mailing-list
         :list-id:x-google-group-id:list-post:list-help:list-archive
         :list-subscribe:list-unsubscribe:content-type;
        bh=TddBTv+9sQo60rAebC6ycchtvVu3pPtYDQc69O5uFlA=;
        b=n7srmI4cfbSgq1Hb9Ncz8GM9NhV5l4MpHQu4vXKBCVLJlwSzMQhmSUc4IjPe95ABYa
         46zBChmbo2rQbRB69pdWPY3XZLY4KOaEqHvCUr7kfpVZgkMX0Q8ohSlY4jszJ2+fBYkd
         7hQep8O3uAKX1T6qOshmEK6chJ/12dPckhhsG7L+og8WtqrtEgy30QQUMBSx+rztcrhs
         6NjBIDZrnYLS9+U+ZLaZWdwNVnZLvs04DFHnEUBaQVd4QDkq8ZFBgmh0zGDejqnKxIeg
         qLstO28KFrNLoKmzPpI/Y829lbKe+itvwyVGjm+UBo5xyD7GdeUzJz0tpYpr1rCdwoJq
         UkRA==
X-Received: by 10.224.207.66 with SMTP id fx2mr32763288qab.7.1357409226968;
        Sat, 05 Jan 2013 10:07:06 -0800 (PST)
X-BeenThere: std-proposals@isocpp.org
Original-Received: by 10.49.0.19 with SMTP id 19ls7573983qea.55.gmail; Sat, 05 Jan 2013
 10:07:05 -0800 (PST)
X-Received: by 10.49.48.41 with SMTP id i9mr9510243qen.36.1357409225026;
        Sat, 05 Jan 2013 10:07:05 -0800 (PST)
X-Original-Sender: atch.cpp@gmail.com
Precedence: list
Mailing-list: list std-proposals@isocpp.org; contact std-proposals+owners@isocpp.org
List-ID: <std-proposals.isocpp.org>
X-Google-Group-Id: 399137483710
List-Post: <http://groups.google.com/a/isocpp.org/group/std-proposals/post?hl=en>,
 <mailto:std-proposals@isocpp.org>
List-Help: <http://support.google.com/a/isocpp.org/bin/topic.py?hl=en&topic=25838>,
 <mailto:std-proposals+help@isocpp.org>
List-Archive: <http://groups.google.com/a/isocpp.org/group/std-proposals/?hl=en>
List-Subscribe: <http://groups.google.com/a/isocpp.org/group/std-proposals/subscribe?hl=en>,
 <mailto:std-proposals+subscribe@isocpp.org>
List-Unsubscribe: <http://groups.google.com/a/isocpp.org/group/std-proposals/subscribe?hl=en>,
 <mailto:googlegroups-manage+399137483710+unsubscribe@googlegroups.com>
Xref: news.gmane.org gmane.comp.lang.c++.isocpp.proposals:1448
Archived-At: <http://permalink.gmane.org/gmane.comp.lang.c++.isocpp.proposals/1448>

------=_Part_1718_9219898.1357409223686
Content-Type: text/plain; charset=ISO-8859-1

I wonder if anyone feels the same as me about using declaration while 
specifying members from base class? As things are now, it is very blunt and 
not very precise tool, which could be quite easily tweaked.
What I mean is:

class A
{
public:
void f();
void f(int);
};

class B: public A
{
using A::f;//here we cannot make a choice on which one we would like to use 
in our B class, which sometimes is ok...
};

but in scenario:
class A
{
void f(int);
public:
void f();
};

class B :public A
{
using A::f;//will not compile even though the only fnc we want is A::f()
};

What I would like to propose is following backwards compatible syntax:

class B :public A
{
using A::f;//here I'm specifying that I want use every fnc 'f' from A - 
just like before, but this will not compile
using A::f();//here I explicitly specify which fnc I want to use
};

The use case which is I believe compelling is the one that if function f 
overloaded and one or more is declared  private, this actively prohibits us 
from the use of any other, non-private functions 'f' from the base class.

Looking forward to comments.

-- 




------=_Part_1718_9219898.1357409223686
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable

I wonder if anyone feels the same as me about using declaration while speci=
fying members from base class? As things are now, it is very blunt and not =
very precise tool, which could be quite easily tweaked.<div>What I mean is:=
</div><div><br></div><div>class A</div><div>{</div><div>public:</div><div>v=
oid f();</div><div>void f(int);</div><div>};<br></div><div><br></div><div>c=
lass B: public A</div><div>{</div><div>using A::f;//here we cannot make a c=
hoice on which one we would like to use in our B class, which sometimes is =
ok...</div><div>};</div><div><br></div><div>but in scenario:</div><div>clas=
s A</div><div>{</div><div>void f(int);</div><div>public:</div><div>void f()=
;</div><div>};</div><div><br></div><div>class B :public A</div><div>{</div>=
<div>using A::f;//will not compile even though the only fnc we want is A::f=
()</div><div>};</div><div><br></div><div>What I would like to propose is fo=
llowing backwards compatible syntax:</div><div><br></div><div><div>class B =
:public A</div><div>{</div><div>using A::f;//here I'm specifying that I wan=
t use every fnc 'f' from A - just like before, but this will not compile</d=
iv><div>using A::f();//here I explicitly specify which fnc I want to use</d=
iv><div>};</div></div><div><br></div><div>The use case which is I believe&n=
bsp;compelling is the one that if function f overloaded and one or more is =
declared&nbsp;&nbsp;private, this actively prohibits us from the use of any=
 other, non-private functions 'f' from the base class.</div><div><br></div>=
<div>Looking forward to comments.</div><div><br></div>

<p></p>

-- <br />
&nbsp;<br />
&nbsp;<br />
&nbsp;<br />

------=_Part_1718_9219898.1357409223686--

.
