220 7394 <CAGNvRgDk7W0GjT7im2_86M84pGgZBbor03T+DE6M8-WqHJPvdA@mail.gmail.com> article
Path: news.gmane.org!not-for-mail
From: =?ISO-8859-1?Q?Daniel_Kr=FCgler?= <daniel.kruegler@gmail.com>
Newsgroups: gmane.comp.lang.c++.isocpp.proposals
Subject: Re: Re: std::any: Add a way to obtain a void* to the
 contained value.
Date: Tue, 22 Oct 2013 10:15:05 +0200
Lines: 37
Approved: news@gmane.org
Message-ID: <CAGNvRgDk7W0GjT7im2_86M84pGgZBbor03T+DE6M8-WqHJPvdA@mail.gmail.com>
References: <2542b0a1-d4db-48d8-97e3-05dd31ba569f@isocpp.org>
	<f71380af-12dc-4c20-b7d3-efc45a1b12e1@isocpp.org>
	<CAGNvRgAw4M8+-fY=dOBze94nG_21HfU4gnEhh9Np--DyRr7cVg@mail.gmail.com>
Reply-To: std-proposals@isocpp.org
NNTP-Posting-Host: plane.gmane.org
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
X-Trace: ger.gmane.org 1382429704 19491 80.91.229.3 (22 Oct 2013 08:15:04 GMT)
X-Complaints-To: usenet@ger.gmane.org
NNTP-Posting-Date: Tue, 22 Oct 2013 08:15:04 +0000 (UTC)
To: std-proposals@isocpp.org
Original-X-From: std-proposals+bncBCT7RVFA4QORBCXITCJQKGQENXMDK2Q@isocpp.org Tue Oct 22 10:15:09 2013
Return-path: <std-proposals+bncBCT7RVFA4QORBCXITCJQKGQENXMDK2Q@isocpp.org>
Envelope-to: gclcip-std-proposals@m.gmane.org
Original-Received: from mail-wg0-f70.google.com ([74.125.82.70])
	by plane.gmane.org with esmtp (Exim 4.69)
	(envelope-from <std-proposals+bncBCT7RVFA4QORBCXITCJQKGQENXMDK2Q@isocpp.org>)
	id 1VYX7K-0005de-Ue
	for gclcip-std-proposals@m.gmane.org; Tue, 22 Oct 2013 10:15:06 +0200
Original-Received: by mail-wg0-f70.google.com with SMTP id c11sf9684642wgh.9
        for <gclcip-std-proposals@m.gmane.org>; Tue, 22 Oct 2013 01:15:06 -0700 (PDT)
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20130820;
        h=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:list-post:list-help:list-archive
         :list-subscribe:list-unsubscribe:content-type
         :content-transfer-encoding;
        bh=nQ2THk65WdxIaAeL9hD7VT6SKlwCfd739aZuzaYvP/I=;
        b=ZW/tFuWUb2uRezewatUcsH9oifuqxo/Ao7Sdj/F6bUVJilnrznW7t4/vpUzBp6E7ch
         9JVTvvw7w88hYbJonEf/5uL5cLAE62bQULmNmUDjwUthZqS59ddGzKfV5YoxeKYNkV57
         ejhMNI2TbwTIa9wFXq8Z3p8GnD97XO4tHitvU2u/ZPfOFaWiL8mZb2F4bSPQnu+JBxK0
         faMrtvSiDAUvhUSDNDqKI5Yw96fMp3h0ifMb66DdaasKXF+xufrD4YdpqKq04unbOEYt
         uY8ota28aaMFTEN5CLPG+339vajgh4uPoKFait2DJ+2k3JZZBm/J6cdL1AkdrDepS91a
         uFtw==
X-Received: by 10.181.11.165 with SMTP id ej5mr6579379wid.0.1382429706298;
        Tue, 22 Oct 2013 01:15:06 -0700 (PDT)
X-BeenThere: std-proposals@isocpp.org
Original-Received: by 10.180.86.73 with SMTP id n9ls598265wiz.34.canary; Tue, 22 Oct
 2013 01:15:05 -0700 (PDT)
X-Received: by 10.180.89.42 with SMTP id bl10mr13025608wib.47.1382429705823;
        Tue, 22 Oct 2013 01:15:05 -0700 (PDT)
Original-Received: from mail-wg0-x22b.google.com (mail-wg0-x22b.google.com [2a00:1450:400c:c00::22b])
        by mx.google.com with ESMTPS id vu5si1515387wjc.7.2013.10.22.01.15.05
        for <std-proposals@isocpp.org>
        (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128);
        Tue, 22 Oct 2013 01:15:05 -0700 (PDT)
Received-SPF: pass (google.com: domain of daniel.kruegler@gmail.com designates 2a00:1450:400c:c00::22b as permitted sender) client-ip=2a00:1450:400c:c00::22b;
Original-Received: by mail-wg0-f43.google.com with SMTP id b13so7527360wgh.34
        for <std-proposals@isocpp.org>; Tue, 22 Oct 2013 01:15:05 -0700 (PDT)
X-Received: by 10.180.101.197 with SMTP id fi5mr13401451wib.46.1382429705726;
 Tue, 22 Oct 2013 01:15:05 -0700 (PDT)
Original-Received: by 10.216.169.71 with HTTP; Tue, 22 Oct 2013 01:15:05 -0700 (PDT)
In-Reply-To: <CAGNvRgAw4M8+-fY=dOBze94nG_21HfU4gnEhh9Np--DyRr7cVg@mail.gmail.com>
X-Original-Sender: daniel.kruegler@gmail.com
X-Original-Authentication-Results: mx.google.com;       spf=pass (google.com:
 domain of daniel.kruegler@gmail.com designates 2a00:1450:400c:c00::22b as
 permitted sender) smtp.mail=daniel.kruegler@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:7394
Archived-At: <http://permalink.gmane.org/gmane.comp.lang.c++.isocpp.proposals/7394>

2013/10/22 Daniel Kr=FCgler <daniel.kruegler@gmail.com>:
> 2013/10/22  <stackmachine@hotmail.com>:
>> Here's the code of unsafe_any_cast:
>>
>> template<typename ValueType>
>> inline ValueType * unsafe_any_cast(any * operand) BOOST_NOEXCEPT
>> {
>>         return &static_cast<any::holder<ValueType>
>> *>(operand->content)->held;
>> }
>>
>> If I instantiate this template, I get a static_cast<any::holder<void*>*>=
..
>> This is UB.
>
> Please look at the suggestion from the view-point of an API
> suggestion, not by looking into the code. It all depends what the
> specification would be and a library internal can decide how to
> realize that. If the specification says that you can query for void*,
> it needs to work - regardless of the internal way how to do that.

That being said I agree that unsafe_any_cast is not what you have been
asking for.

> - Daniel

--=20

---=20
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 e=
mail 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-proposa=
ls/.

.
