220 14313 <m2qvok$1ua$1@ger.gmane.org> article
Path: news.gmane.org!not-for-mail
From: Matthew Woehlke <mw_triad@users.sourceforge.net>
Newsgroups: gmane.comp.lang.c++.isocpp.proposals
Subject: Re: Omitting namespace/class scopes for scoped enums
Date: Wed, 29 Oct 2014 11:05:56 -0400
Lines: 52
Approved: news@gmane.org
Message-ID: <m2qvok$1ua$1@ger.gmane.org>
References: <122fe218-d42a-4266-9b5a-f4d70ac56119@isocpp.org> <48626aa2-a6bd-4e7f-9fd6-a32bdb58e72c@isocpp.org> <16075892.pYMiFCkgnF@tjmaciei-mobl4> <e9b34c6b-8e5d-4579-90c5-93dac7b8e030@isocpp.org>
Reply-To: std-proposals@isocpp.org
NNTP-Posting-Host: plane.gmane.org
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8
X-Trace: ger.gmane.org 1414595182 7343 80.91.229.3 (29 Oct 2014 15:06:22 GMT)
X-Complaints-To: usenet@ger.gmane.org
NNTP-Posting-Date: Wed, 29 Oct 2014 15:06:22 +0000 (UTC)
To: std-proposals@isocpp.org
Original-X-From: std-proposals+bncBCO5FYHBU4ERBZEEYSRAKGQEIQDLM6Y@isocpp.org Wed Oct 29 16:06:15 2014
Return-path: <std-proposals+bncBCO5FYHBU4ERBZEEYSRAKGQEIQDLM6Y@isocpp.org>
Envelope-to: gclcip-std-proposals@m.gmane.org
Original-Received: from mail-wg0-f72.google.com ([74.125.82.72])
	by plane.gmane.org with esmtp (Exim 4.69)
	(envelope-from <std-proposals+bncBCO5FYHBU4ERBZEEYSRAKGQEIQDLM6Y@isocpp.org>)
	id 1XjUpB-0006Al-Rx
	for gclcip-std-proposals@m.gmane.org; Wed, 29 Oct 2014 16:06:13 +0100
Original-Received: by mail-wg0-f72.google.com with SMTP id k14sf1819137wgh.7
        for <gclcip-std-proposals@m.gmane.org>; Wed, 29 Oct 2014 08:06:13 -0700 (PDT)
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20130820;
        h=x-gm-message-state:to:from:subject:date:lines:message-id:references
         :mime-version:user-agent:in-reply-to:x-original-sender
         :x-original-authentication-results:reply-to:precedence:mailing-list
         :list-id:list-post:list-help:list-archive:list-subscribe
         :list-unsubscribe:content-type;
        bh=LDhxN/mQXX86W1galCRytV9KVdbY13NfCldkm1wZEcY=;
        b=YftiPwS0WeCapz+SltnjupGwJZtcE0ndBBqLkvOP2XoIfk0WEVj7HcxHJz/SvqOF/S
         UcLOPtcphUhvD+wlyILqadkMS160zz6MTiGKPGToDXKSlVmKuiYP0mp3vrEyWFzxicNI
         eleG+6MqzwR82mXTEylowVhdkYmLL//Ycbm36EVHtwnqcmrx41WuB1AoLo6wJgyHQAnB
         FCet7IMwDIlOm+pBf+jjYK1FrTlQqMHJNhUNhTxP9ch+nosfEoArDY9O4NipqQQOoUOC
         T3v+u0LHqT2U0kR77Q4kjKIZ+ND6FXOX4ijh3K0JoY/BJtJSrvILv/H1cgRHF+R2dEgN
         4Vuw==
X-Gm-Message-State: ALoCoQkzHmhhyYYrX2Lx/Nn/+qIdmcaBvpAJJNHrOrn4Nni8XJpl/flKJEuU1Bu2I3ViGGfZ+6kI
X-Received: by 10.180.73.73 with SMTP id j9mr5092058wiv.3.1414595173540;
        Wed, 29 Oct 2014 08:06:13 -0700 (PDT)
X-BeenThere: std-proposals@isocpp.org
Original-Received: by 10.152.44.229 with SMTP id h5ls231967lam.4.gmail; Wed, 29 Oct
 2014 08:06:11 -0700 (PDT)
X-Received: by 10.112.147.225 with SMTP id tn1mr11996161lbb.37.1414595171852;
        Wed, 29 Oct 2014 08:06:11 -0700 (PDT)
Original-Received: from plane.gmane.org (plane.gmane.org. [80.91.229.3])
        by mx.google.com with ESMTPS id nu7si7651077lbb.18.2014.10.29.08.06.11
        for <std-proposals@isocpp.org>
        (version=TLSv1 cipher=RC4-SHA bits=128/128);
        Wed, 29 Oct 2014 08:06:11 -0700 (PDT)
Received-SPF: pass (google.com: domain of gclcip-std-proposals@m.gmane.org designates 80.91.229.3 as permitted sender) client-ip=80.91.229.3;
Original-Received: from list by plane.gmane.org with local (Exim 4.69)
	(envelope-from <gclcip-std-proposals@m.gmane.org>)
	id 1XjUp6-00066Y-AB
	for std-proposals@isocpp.org; Wed, 29 Oct 2014 16:06:08 +0100
Original-Received: from cpe-67-240-43-113.nycap.res.rr.com ([67.240.43.113])
        by main.gmane.org with esmtp (Gmexim 0.1 (Debian))
        id 1AlnuQ-0007hv-00
        for <std-proposals@isocpp.org>; Wed, 29 Oct 2014 16:06:08 +0100
Original-Received: from mw_triad by cpe-67-240-43-113.nycap.res.rr.com with local (Gmexim 0.1 (Debian))
        id 1AlnuQ-0007hv-00
        for <std-proposals@isocpp.org>; Wed, 29 Oct 2014 16:06:08 +0100
X-Injected-Via-Gmane: http://gmane.org/
Original-Lines: 43
Original-X-Complaints-To: usenet@ger.gmane.org
X-Gmane-NNTP-Posting-Host: cpe-67-240-43-113.nycap.res.rr.com
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.1.1
In-Reply-To: <e9b34c6b-8e5d-4579-90c5-93dac7b8e030@isocpp.org>
X-Original-Sender: mw_triad@users.sourceforge.net
X-Original-Authentication-Results: mx.google.com;       spf=pass (google.com:
 domain of gclcip-std-proposals@m.gmane.org designates 80.91.229.3 as
 permitted sender) smtp.mail=gclcip-std-proposals@m.gmane.org
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>, <mailto:std-proposals@isocpp.org>
List-Help: <http://support.google.com/a/isocpp.org/bin/topic.py?topic=25838>, <mailto:std-proposals+help@isocpp.org>
List-Archive: <http://groups.google.com/a/isocpp.org/group/std-proposals/>
List-Subscribe: <http://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>,
 <http://groups.google.com/a/isocpp.org/group/std-proposals/subscribe>
Xref: news.gmane.org gmane.comp.lang.c++.isocpp.proposals:14313
Archived-At: <http://permalink.gmane.org/gmane.comp.lang.c++.isocpp.proposals/14313>

On 2014-10-28 16:39, Myriachan wrote:
> I previously wanted to propose a "using namespace" extension, where you 
> could specify a class name or enum name rather than just namespaces, but 
> this thread looks like a similar topic, so I'll mention what I was going to 
> propose.

I also desperately want this, at least for enums. Note for me though
that what I want to write is more like:

  namespace zoo
  {
    enum class animal
    {
      monkey,
      tiger,
      elephant
    };
    using enum animal;
  }

....and elsewhere:

  auto a = zoo::monkey; // okay; animal values in 'zoo' scope

That is, I want to be able to promote the values of a strongly typed
enum into a class or namespace scope (i.e. this would be in a header!).
I find that the additional scoping causes me to not want to use strongly
typed enums in many or even most cases. IMHO the feature is broken for
this reason.

Discussed elsewhere, but FWIW my inclination (as seen above) is toward
'using namespace/class/enum' rather than 'using namespace' for all
three. (But I'd happily take 'using namespace Enum' over not having the
feature at all.)

Keep in mind that you should probably specify that this is transitive,
i.e. given the above, 'using namespace zoo' should also bring the values
of 'animal' into the current scope. (You probably already know/expect
this, I'm mostly pointing out that it should probably be explicitly
mentioned in an official proposal.)

-- 
Matthew

-- 

--- 
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.
Visit this group at http://groups.google.com/a/isocpp.org/group/std-proposals/.

.
