220 5411 <1374042897.4347.6.camel@sara> article
Path: news.gmane.org!not-for-mail
From: Magnus Fromreide <magfr@lysator.liu.se>
Newsgroups: gmane.comp.lang.c++.isocpp.proposals
Subject: Re: Re: Overloaded Declarators
Date: Wed, 17 Jul 2013 08:34:57 +0200
Lines: 38
Approved: news@gmane.org
Message-ID: <1374042897.4347.6.camel@sara>
References: <82b89c5e-ce4e-49c0-82b2-d6032631e3e3@isocpp.org>
	 <0bd76d6d-a1f2-4c29-82e8-99dbb5358453@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 1374042900 7053 80.91.229.3 (17 Jul 2013 06:35:00 GMT)
X-Complaints-To: usenet@ger.gmane.org
NNTP-Posting-Date: Wed, 17 Jul 2013 06:35:00 +0000 (UTC)
Cc: andrewtomazos@gmail.com
To: std-proposals@isocpp.org
Original-X-From: std-proposals+bncBDELLREETMBRBE7WTCHQKGQEKVAKJGQ@isocpp.org Wed Jul 17 08:35:00 2013
Return-path: <std-proposals+bncBDELLREETMBRBE7WTCHQKGQEKVAKJGQ@isocpp.org>
Envelope-to: gclcip-std-proposals@m.gmane.org
Original-Received: from mail-bk0-f71.google.com ([209.85.214.71])
	by plane.gmane.org with esmtp (Exim 4.69)
	(envelope-from <std-proposals+bncBDELLREETMBRBE7WTCHQKGQEKVAKJGQ@isocpp.org>)
	id 1UzLKG-0000ph-O8
	for gclcip-std-proposals@m.gmane.org; Wed, 17 Jul 2013 08:35:00 +0200
Original-Received: by mail-bk0-f71.google.com with SMTP id ik8sf1625290bkc.10
        for <gclcip-std-proposals@m.gmane.org>; Tue, 16 Jul 2013 23:35:00 -0700 (PDT)
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=google.com; s=20120113;
        h=x-beenthere:message-id:subject:from:to:cc:date:in-reply-to
         :references:x-mailer:mime-version:x-virus-scanned: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=3SV/go4xq49GZ2X4Zuj4M01qnQfj1Bm9jZfR4fNO2to=;
        b=YxMnk8SWbvxM2O+que7yQVCljE2FCsFE9EvZjY7CZPm9+vde7rSgyqwTC1wWTh7okn
         V3DGRdqfizc2NSblx9mz5Z0cXct2yL0QQocElsRntdMttci3k/uYBCgmi/OMseUszaqA
         i8l+gqz1xA1QrY4Bc74tf9gaxoI5U5pP3ZCQQ8tPDr8OBuUBRDJvwxacVdeN7zQBYJj1
         LLgLllF4R9LbJOES3XEuMZV7GE2DbxTOGGbTlE2jIYe6mcPctoLe+ZeNU64evWSwiF+1
         iKzC4Pv4x9dGJKVDNvT45YeoKc+4tiIv2dWPles7rowYA+Ip5cgOuhvWnmv3pxlMbKgU
          
X-Received: by 10.152.20.73 with SMTP id l9mr1256011lae.1.1374042899866;
        Tue, 16 Jul 2013 23:34:59 -0700 (PDT)
X-BeenThere: std-proposals@isocpp.org
Original-Received: by 10.152.43.198 with SMTP id y6ls41806lal.38.gmail; Tue, 16 Jul
 2013 23:34:58 -0700 (PDT)
X-Received: by 10.112.63.2 with SMTP id c2mr2555028lbs.6.1374042898579;
        Tue, 16 Jul 2013 23:34:58 -0700 (PDT)
Original-Received: from mail.lysator.liu.se (mail.lysator.liu.se. [2001:6b0:17:f0a0::3])
        by mx.google.com with ESMTPS id e6si2569733lbv.122.2013.07.16.23.34.57
        for <std-proposals@isocpp.org>
        (version=TLSv1 cipher=RC4-SHA bits=128/128);
        Tue, 16 Jul 2013 23:34:58 -0700 (PDT)
Received-SPF: pass (google.com: domain of magfr@lysator.liu.se designates 2001:6b0:17:f0a0::3 as permitted sender) client-ip=2001:6b0:17:f0a0::3;
Original-Received: from mail.lysator.liu.se (localhost [127.0.0.1])
	by mail.lysator.liu.se (Postfix) with ESMTP id 8C9764000C;
	Wed, 17 Jul 2013 08:34:57 +0200 (CEST)
Original-Received: from [192.168.0.101] (h-149-24.a163.priv.bahnhof.se [81.170.149.24])
	(using SSLv3 with cipher AES256-SHA (256/256 bits))
	(No client certificate requested)
	by mail.lysator.liu.se (Postfix) with ESMTPSA id 71A8D4000B;
	Wed, 17 Jul 2013 08:34:57 +0200 (CEST)
In-Reply-To: <0bd76d6d-a1f2-4c29-82e8-99dbb5358453@isocpp.org>
X-Mailer: Evolution 3.4.4-3
X-Virus-Scanned: ClamAV using ClamSMTP
X-Original-Sender: magfr@lysator.liu.se
X-Original-Authentication-Results: mx.google.com;       spf=pass (google.com:
 domain of magfr@lysator.liu.se designates 2001:6b0:17:f0a0::3 as permitted
 sender) smtp.mail=magfr@lysator.liu.se
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: <http://groups.google.com/a/isocpp.org/group/std-proposals/subscribe>,
 <mailto:googlegroups-manage+399137483710+unsubscribe@googlegroups.com>
Xref: news.gmane.org gmane.comp.lang.c++.isocpp.proposals:5411
Archived-At: <http://permalink.gmane.org/gmane.comp.lang.c++.isocpp.proposals/5411>

On Tue, 2013-07-16 at 23:16 -0700, stackmachine@hotmail.com wrote:
> I think this feature has potential but needs more work. Overloading
> existing declarators is dangerous as has already been pointed out.
> Instead I would like to see custom declarators. e.g.:
> {int, double, std::string} x = {42, 3.14, "foo"}; // {T...} means
> std::tuple<T...>
> std::string -> int m = {{"foo", 1}, {"bar", 2}}; // K -> V means
> std::map<K, V>
> [int] x = { 1, 2, 3, 4, 5 }; // [T] means std::vector<T>

I do not think this makes for easier to read C++ code.

The only thing I could imagine as possibly useful would be

std::vector<auto> v = { 1, 2, 3 };

but I think the benefit of that is quite low as well since it is
syntactic sugar for

template <class T> inline std::vector<T>
make_vector(std::initializer_list<T> il) {
  return std::vector<T>(il);
}
auto v = make_vector({ 1, 2, 3 });

/MF


-- 

--- 
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/.



.
