220 7367 <CAGNvRgCKPn2q8-ySv-xKy+9ju1YSbmw0H1onTNwbH-EdvzgNxg@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: Sat, 19 Oct 2013 17:11:39 +0200
Lines: 34
Approved: news@gmane.org
Message-ID: <CAGNvRgCKPn2q8-ySv-xKy+9ju1YSbmw0H1onTNwbH-EdvzgNxg@mail.gmail.com>
References: <2542b0a1-d4db-48d8-97e3-05dd31ba569f@isocpp.org>
	<8bae8544-fab3-4b4a-a66c-0d48ae58d346@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 1382195497 17373 80.91.229.3 (19 Oct 2013 15:11:37 GMT)
X-Complaints-To: usenet@ger.gmane.org
NNTP-Posting-Date: Sat, 19 Oct 2013 15:11:37 +0000 (UTC)
To: std-proposals@isocpp.org
Original-X-From: std-proposals+bncBCT7RVFA4QORBK6CRKJQKGQEPTTO6CQ@isocpp.org Sat Oct 19 17:11:42 2013
Return-path: <std-proposals+bncBCT7RVFA4QORBK6CRKJQKGQEPTTO6CQ@isocpp.org>
Envelope-to: gclcip-std-proposals@m.gmane.org
Original-Received: from mail-ea0-f197.google.com ([209.85.215.197])
	by plane.gmane.org with esmtp (Exim 4.69)
	(envelope-from <std-proposals+bncBCT7RVFA4QORBK6CRKJQKGQEPTTO6CQ@isocpp.org>)
	id 1VXYBp-0007bf-On
	for gclcip-std-proposals@m.gmane.org; Sat, 19 Oct 2013 17:11:41 +0200
Original-Received: by mail-ea0-f197.google.com with SMTP id m14sf5908158eaj.8
        for <gclcip-std-proposals@m.gmane.org>; Sat, 19 Oct 2013 08:11:41 -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;
        bh=CtDgNBMkxT1ouyQwkZQ9Gylocuff8exi2fwHAXo/8GA=;
        b=FKD+Vm0lY/BQj83NVPH9DcUcW5qnTLnKOzG4g5KRX8yeMX+50BIIxvfTG9rbrKhWCh
         yMYcKSw3W9hR07ZyFShl8z5lt950Vrt+sLosi/VmUpg3wGmSajo2pojB9RW1Aqx2Bp+Y
         3eN2o4A0lkssbEJ+MbmTcn6hu5Cq45t0VzDV0Qs5LNiyqVwQPCFIZq3Ri3vd/lMJRrZN
         BUaYBzMty9bB/73AQzLz4kzfXBghhgXItzo5ItxC9sS2f6gHWxsjnOGYHTupaFgcfQ3J
         BknAm/Gd92Z2xNTk8mclf9WR9t4VLwAc+0Z3fE2uGifxfBJx1WdESBkfgwC/AuBtessZ
         mXYA==
X-Received: by 10.112.50.175 with SMTP id d15mr3359504lbo.12.1382195500675;
        Sat, 19 Oct 2013 08:11:40 -0700 (PDT)
X-BeenThere: std-proposals@isocpp.org
Original-Received: by 10.180.102.105 with SMTP id fn9ls269294wib.29.gmail; Sat, 19 Oct
 2013 08:11:39 -0700 (PDT)
X-Received: by 10.180.187.41 with SMTP id fp9mr3321197wic.33.1382195499522;
        Sat, 19 Oct 2013 08:11:39 -0700 (PDT)
Original-Received: from mail-wg0-x234.google.com (mail-wg0-x234.google.com [2a00:1450:400c:c00::234])
        by mx.google.com with ESMTPS id fv15si2119444wjc.70.2013.10.19.08.11.39
        for <std-proposals@isocpp.org>
        (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128);
        Sat, 19 Oct 2013 08:11:39 -0700 (PDT)
Received-SPF: pass (google.com: domain of daniel.kruegler@gmail.com designates 2a00:1450:400c:c00::234 as permitted sender) client-ip=2a00:1450:400c:c00::234;
Original-Received: by mail-wg0-f52.google.com with SMTP id f12so4892892wgh.31
        for <std-proposals@isocpp.org>; Sat, 19 Oct 2013 08:11:39 -0700 (PDT)
X-Received: by 10.180.95.202 with SMTP id dm10mr3378492wib.62.1382195499320;
 Sat, 19 Oct 2013 08:11:39 -0700 (PDT)
Original-Received: by 10.216.169.71 with HTTP; Sat, 19 Oct 2013 08:11:39 -0700 (PDT)
In-Reply-To: <8bae8544-fab3-4b4a-a66c-0d48ae58d346@isocpp.org>
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::234 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:7367
Archived-At: <http://permalink.gmane.org/gmane.comp.lang.c++.isocpp.proposals/7367>

2013/10/19  <stackmachine@hotmail.com>:
> That's still some kind of overhead.

The access to the underlying object should be exactly equal to your
suggested function returning void*, except the additional test of two
type_info objects that were obtained from compile-time known types, so
this is no additional "polymorphic" overhead.

Did you have tested the performance overhead compared to your
envisioned access? Some data would be nice to have.

Given the fact that std::any claims to be a "typesafe void*", such a
function providing direct access to void* makes me a bit nervous at
the moment, especially since I'm not seeing comparable access to the
underlying object by similar types such as std::function::target or
std::shared_ptr's get_deleter template.

If we have the general feeling that such direct access to underlying
objects should be provided, I would like to see a more general
protocol for this (e.g. via a trait-like template that could be
specialized for types that we would consider as good candidates. So, I
think, missing to provide that feature now could be changed in the
future.

- Daniel

-- 

--- 
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/.

.
