220 11618 <0329E32D-0EC2-4BE0-85D0-492A4CF22B0B@gmail.com> article
Path: news.gmane.org!not-for-mail
From: David Krauss <potswa@gmail.com>
Newsgroups: gmane.comp.lang.c++.isocpp.proposals
Subject: Re: Controversy and debate: Uninitialized variables
 by default is a bug
Date: Mon, 30 Jun 2014 23:52:34 +0800
Lines: 27
Approved: news@gmane.org
Message-ID: <0329E32D-0EC2-4BE0-85D0-492A4CF22B0B@gmail.com>
References: <60caa4ef-b32d-40fe-97b6-8918fbb2bd51@isocpp.org> <CAGg_6+Ossg1SPRDSw5qnHR4ZW8NrgT4W8z7uHLAgD7mvfh-wtQ@mail.gmail.com> <ec6e4a5c-c6c9-4921-ac4c-38373fc219ae@isocpp.org> <20140620202026.GA29898@bacon.lysator.liu.se>
Reply-To: std-proposals@isocpp.org
NNTP-Posting-Host: plane.gmane.org
Mime-Version: 1.0 (Mac OS X Mail 7.3 \(1878.2\))
Content-Type: text/plain; charset=ISO-8859-1
X-Trace: ger.gmane.org 1404143586 30596 80.91.229.3 (30 Jun 2014 15:53:06 GMT)
X-Complaints-To: usenet@ger.gmane.org
NNTP-Posting-Date: Mon, 30 Jun 2014 15:53:06 +0000 (UTC)
To: std-proposals@isocpp.org
Original-X-From: std-proposals+bncBCW25A7E3QCRBS4PY2OQKGQEDBKKU7Y@isocpp.org Mon Jun 30 17:52:59 2014
Return-path: <std-proposals+bncBCW25A7E3QCRBS4PY2OQKGQEDBKKU7Y@isocpp.org>
Envelope-to: gclcip-std-proposals@m.gmane.org
Original-Received: from mail-pd0-f199.google.com ([209.85.192.199])
	by plane.gmane.org with esmtp (Exim 4.69)
	(envelope-from <std-proposals+bncBCW25A7E3QCRBS4PY2OQKGQEDBKKU7Y@isocpp.org>)
	id 1X1dsr-00059Y-TH
	for gclcip-std-proposals@m.gmane.org; Mon, 30 Jun 2014 17:52:46 +0200
Original-Received: by mail-pd0-f199.google.com with SMTP id r10sf39975412pdi.10
        for <gclcip-std-proposals@m.gmane.org>; Mon, 30 Jun 2014 08:52:44 -0700 (PDT)
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20130820;
        h=x-gm-message-state:mime-version:subject:from:in-reply-to:date
         :message-id:references: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=SZdH9QHvtxKVQgy1vVKUGzZ4FAH7252f/8YQv5+KMNU=;
        b=bdyAk3KwgkcLNZEhndHLJdUX95fh/DjwCGvTAKhmybryt4HePHjl3U6O5OdWC2WuEj
         /dncqvF53EPcH1/CXAf/oswmcFn7qVc+pyzcaxjM1JehTY3yJOtgxwHfGAvZSpwPjFtl
         /T3SOYTJb5A0RF1SNfhTjwb82p0TancOWn1ps5yDzLbMijFv6zFjhazSD4AesLNXyMz7
         dYpWcfppKO0itlsiXbYbsRADsqYsb91zIqOcmSioa8s0DjKu0u5gqfPXrkfmV3SJFX2U
         yfqACzfeMiEDvGCYQyir5maL4DDVZDkyqLUdLM/u9LUByUGO/W7/HdXrFYPwxZLos0f4
         c+eg==
X-Gm-Message-State: ALoCoQkqGjs2HCmjfkK74jcUCjAl/f9hFsdm7NZjtyJinJzwTNELDoqHmmPGA1xGSreb0QR2+kmz
X-Received: by 10.66.160.34 with SMTP id xh2mr21849576pab.6.1404143564647;
        Mon, 30 Jun 2014 08:52:44 -0700 (PDT)
X-BeenThere: std-proposals@isocpp.org
Original-Received: by 10.50.136.168 with SMTP id qb8ls1719510igb.43.gmail; Mon, 30 Jun
 2014 08:52:42 -0700 (PDT)
X-Received: by 10.42.67.203 with SMTP id u11mr39270106ici.20.1404143562843;
        Mon, 30 Jun 2014 08:52:42 -0700 (PDT)
Original-Received: from mail-ig0-x236.google.com (mail-ig0-x236.google.com [2607:f8b0:4001:c05::236])
        by mx.google.com with ESMTPS id r10si30032564ico.103.2014.06.30.08.52.42
        for <std-proposals@isocpp.org>
        (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128);
        Mon, 30 Jun 2014 08:52:42 -0700 (PDT)
Received-SPF: pass (google.com: domain of potswa@gmail.com designates 2607:f8b0:4001:c05::236 as permitted sender) client-ip=2607:f8b0:4001:c05::236;
Original-Received: by mail-ig0-f182.google.com with SMTP id l13so4420795iga.9
        for <std-proposals@isocpp.org>; Mon, 30 Jun 2014 08:52:42 -0700 (PDT)
X-Received: by 10.50.55.66 with SMTP id q2mr33826433igp.11.1404143562732;
        Mon, 30 Jun 2014 08:52:42 -0700 (PDT)
Original-Received: from [172.20.10.2] ([121.54.44.92])
        by mx.google.com with ESMTPSA id d4sm5623660igc.5.2014.06.30.08.52.40
        for <std-proposals@isocpp.org>
        (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128);
        Mon, 30 Jun 2014 08:52:42 -0700 (PDT)
In-Reply-To: <20140620202026.GA29898@bacon.lysator.liu.se>
X-Mailer: Apple Mail (2.1878.2)
X-Original-Sender: potswa@gmail.com
X-Original-Authentication-Results: mx.google.com;       spf=pass (google.com:
 domain of potswa@gmail.com designates 2607:f8b0:4001:c05::236 as permitted
 sender) smtp.mail=potswa@gmail.com;       dkim=pass header.i=@gmail.com;
       dmarc=pass (p=NONE dis=NONE) header.from=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>, <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:11618
Archived-At: <http://permalink.gmane.org/gmane.comp.lang.c++.isocpp.proposals/11618>


On 2014-06-21, at 4:20 AM, Magnus Fromreide <magfr@lysator.liu.se> wrote:

> That would probably require some way to detect explicit-non-initialization
> in order to support
> 
> std::vector<int> v(MEGABYTE, __no_init__); // a megabyte vector with
>                                           // unspecified content
> 
> which seems like a natural extension if explicit non-initialization is
> added to the language.


__no_init__ (or uninitialized, or whatever) could be like nullptr, a sole value of its type.

A library-only solution (with conversion functions) would even be workable, but for the fact that you cannot copy an uninitialized object.

It sounds like a nice core language extension.

-- 

--- 
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/.

.
