220 1480 <CAFk2RUZXzRmVckk+U4QnX1x20OCHDUL3LgcJ3g5yFDKyoKqzww@mail.gmail.com> article
Path: news.gmane.org!not-for-mail
From: Ville Voutilainen <ville.voutilainen@gmail.com>
Newsgroups: gmane.comp.lang.c++.isocpp.proposals
Subject: Re: making using declaration more precise
Date: Mon, 7 Jan 2013 21:08:05 +0200
Lines: 56
Approved: news@gmane.org
Message-ID: <CAFk2RUZXzRmVckk+U4QnX1x20OCHDUL3LgcJ3g5yFDKyoKqzww@mail.gmail.com>
References: <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: text/plain; charset=ISO-8859-1
X-Trace: ger.gmane.org 1357585685 27677 80.91.229.3 (7 Jan 2013 19:08:05 GMT)
X-Complaints-To: usenet@ger.gmane.org
NNTP-Posting-Date: Mon, 7 Jan 2013 19:08:05 +0000 (UTC)
To: std-proposals@isocpp.org
Original-X-From: std-proposals+bncBC5JHI7A7ALRBFV2VSDQKGQEB7HPBFI@isocpp.org Mon Jan 07 20:08:23 2013
Return-path: <std-proposals+bncBC5JHI7A7ALRBFV2VSDQKGQEB7HPBFI@isocpp.org>
Envelope-to: gclcip-std-proposals@m.gmane.org
Original-Received: from mail-ie0-f198.google.com ([209.85.223.198])
	by plane.gmane.org with esmtp (Exim 4.69)
	(envelope-from <std-proposals+bncBC5JHI7A7ALRBFV2VSDQKGQEB7HPBFI@isocpp.org>)
	id 1TsI3a-0006sC-J1
	for gclcip-std-proposals@m.gmane.org; Mon, 07 Jan 2013 20:08:22 +0100
Original-Received: by mail-ie0-f198.google.com with SMTP id c10sf81268015ieb.5
        for <gclcip-std-proposals@m.gmane.org>; Mon, 07 Jan 2013 11:08:06 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20120113;
        h=x-received:x-beenthere:x-received:x-received:received-spf
         :mime-version:in-reply-to:references:date:message-id:subject:from:to
         :x-original-sender:x-original-authentication-results:reply-to
         :precedence:mailing-list:list-id:x-google-group-id:list-post
         :list-help:list-archive:list-subscribe:list-unsubscribe:content-type;
        bh=jLSAsgcHS89uRbY2egtOUk7O0I5wdL3iW9gHrH4nKmw=;
        b=ZHxVheCoW9A8ZUB1BHMadaCYXV32TMdwEEXIkZW7iySrpsNdvqBYlIr5QtuBQsWBTA
         J4YtWC1E5y71HqBmp9i66kxp4+RlZEZ9Yu1r5mkYrfU1wrmQmw/WBcMmQLqIPBNkhRQn
         V0kC9dloJJA2Ildvfn558QTHMeVMtgazLN9+jPCg9b+IlXy3vJ1uu91Evlww+mPvvoNh
         IFmr790bzltH5kCNMUmazo8gwFsxj3pngxVi3lrxafkWr3foyGJ+qmqORyUljDd/vDRK
         BL0oxGaz0zW/fxhc/sBlei3xkly2IJ5UvxRhz7Gt5vWla5+nwNZzAC6+W9/xijicmQhF
  
X-Received: by 10.182.154.42 with SMTP id vl10mr1475708obb.14.1357585686143;
        Mon, 07 Jan 2013 11:08:06 -0800 (PST)
X-BeenThere: std-proposals@isocpp.org
Original-Received: by 10.182.134.9 with SMTP id pg9ls1421764obb.44.gmail; Mon, 07 Jan
 2013 11:08:05 -0800 (PST)
X-Received: by 10.60.172.178 with SMTP id bd18mr35173507oec.133.1357585685699;
        Mon, 07 Jan 2013 11:08:05 -0800 (PST)
X-Received: by 10.60.172.178 with SMTP id bd18mr35173505oec.133.1357585685666;
        Mon, 07 Jan 2013 11:08:05 -0800 (PST)
Original-Received: from mail-ob0-f171.google.com (mail-ob0-f171.google.com [209.85.214.171])
        by mx.google.com with ESMTPS id s1si56332247oeb.27.2013.01.07.11.08.05
        (version=TLSv1/SSLv3 cipher=OTHER);
        Mon, 07 Jan 2013 11:08:05 -0800 (PST)
Received-SPF: pass (google.com: domain of ville.voutilainen@gmail.com designates 209.85.214.171 as permitted sender) client-ip=209.85.214.171;
Original-Received: by mail-ob0-f171.google.com with SMTP id dn14so17880928obc.30
        for <std-proposals@isocpp.org>; Mon, 07 Jan 2013 11:08:05 -0800 (PST)
Original-Received: by 10.60.172.200 with SMTP id be8mr35389468oec.0.1357585685510; Mon,
 07 Jan 2013 11:08:05 -0800 (PST)
Original-Received: by 10.76.108.82 with HTTP; Mon, 7 Jan 2013 11:08:05 -0800 (PST)
In-Reply-To: <738f626c-3b23-4c74-9eea-2c2246921a81@isocpp.org>
X-Original-Sender: ville.voutilainen@gmail.com
X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain
 of ville.voutilainen@gmail.com designates 209.85.214.171 as permitted sender)
 smtp.mail=ville.voutilainen@gmail.com; dkim=pass header.i=@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:1480
Archived-At: <http://permalink.gmane.org/gmane.comp.lang.c++.isocpp.proposals/1480>

On 5 January 2013 20:07, Arthur Tchaikovsky <atch.cpp@gmail.com> wrote:
> 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.

The work-around would, I think, be

class B :public A
{
   void f(int x) {A::f(x);}
};

Adding the new syntax doesn't seem to be compelling compared to the
very low cost
of specifying exactly the signatures you want and calling the base
implementation of them.

-- 




.
