220 39294 <c9664ef6-f769-4942-8e44-56761d091efc@isocpp.org> article
Path: news.gmane.org!.POSTED!not-for-mail
From: Thomas Russell <thomas.russell97@gmail.com>
Newsgroups: gmane.comp.lang.c++.isocpp.proposals
Subject: Re: Standardising a type-erased iterator
Date: Mon, 23 Jul 2018 01:01:24 -0700 (PDT)
Lines: 23
Approved: news@gmane.org
Message-ID: <c9664ef6-f769-4942-8e44-56761d091efc@isocpp.org>
References: <09db196a-e818-4d7a-9af1-48f07b2f4c3d@isocpp.org>
 <CALvx3hZkVPxg3E0MBPBeXnNwK9szQ5o6O7Gs2ab_omXt8R8=qw@mail.gmail.com> <24d8f121-aba9-4ead-b107-bc4b72014870@isocpp.org>
 <CALvx3hbfFAyh7twxd73DdPYXkrs8chxjsRL9kYzd5kk2VmgD1Q@mail.gmail.com>
Reply-To: std-proposals@isocpp.org
NNTP-Posting-Host: blaine.gmane.org
Mime-Version: 1.0
Content-Type: multipart/mixed; 
	boundary="----=_Part_7987_945385635.1532332884855"
X-Trace: blaine.gmane.org 1532332761 29098 195.159.176.226 (23 Jul 2018 07:59:21 GMT)
X-Complaints-To: usenet@blaine.gmane.org
NNTP-Posting-Date: Mon, 23 Jul 2018 07:59:21 +0000 (UTC)
To: ISO C++ Standard - Future Proposals <std-proposals@isocpp.org>
Original-X-From: std-proposals+bncBDV75LEATMKRBVMW23NAKGQEYFS3UAQ@isocpp.org Mon Jul 23 09:59:17 2018
Return-path: <std-proposals+bncBDV75LEATMKRBVMW23NAKGQEYFS3UAQ@isocpp.org>
Envelope-to: gclcip-std-proposals@m.gmane.org
Original-Received: from mail-yb0-f197.google.com ([209.85.213.197])
	by blaine.gmane.org with esmtp (Exim 4.84_2)
	(envelope-from <std-proposals+bncBDV75LEATMKRBVMW23NAKGQEYFS3UAQ@isocpp.org>)
	id 1fhVkS-0007TK-3v
	for gclcip-std-proposals@m.gmane.org; Mon, 23 Jul 2018 09:59:16 +0200
Original-Received: by mail-yb0-f197.google.com with SMTP id t14-v6sf9475600ybb.0
        for <gclcip-std-proposals@m.gmane.org>; Mon, 23 Jul 2018 01:01:27 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=isocpp-org.20150623.gappssmtp.com; s=20150623;
        h=date:from:to:message-id:in-reply-to:references:subject:mime-version
         :x-original-sender:reply-to:precedence:mailing-list:list-id
         :list-post:list-help:list-archive:list-subscribe:list-unsubscribe;
        bh=BjyKabz9dUcPLbdwcogKwRIHHaAZkjO7UUjJ7xRUqdU=;
        b=I//bBKy2IEvbrCGqM3v4N4r9CCbW+2kODLBnRUiYUE9/NDZIWXhVjLctxwgOlY6RBc
         bziSnoMJcPQlCRhvptGypswflRwNgA7ZZkdE6+WhkidLKCgwwugJEo7QNcnj1/rZqyjJ
         JU9X/HsyRZ9Pyi9nncWGBImXeUF2ir2jqn4GcLWyrz5VL1OCV/OB58FwNhcJFjQ4xWSL
         eRcUs/JHRdZNChcldpZ25M7jrGuMlZAfmCcC8JENMZNS7tocGykPS7h+UNKwkN7msSNi
         OaJ76R+5rDOXbQT5Dlm9mk9YWNecEEnr5XAkdi7oxaUpZ1vNVkDFBc0Vvo896x0ih5O2
         TEpw==
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20161025;
        h=date:from:to:message-id:in-reply-to:references:subject:mime-version
         :x-original-sender:reply-to:precedence:mailing-list:list-id
         :list-post:list-help:list-archive:list-subscribe:list-unsubscribe;
        bh=BjyKabz9dUcPLbdwcogKwRIHHaAZkjO7UUjJ7xRUqdU=;
        b=cHTplCOp177Rnxk8mkmf0sE3iE6oD803EOB6XJfooSZC5oXaKbqj2sgS3uUJEtUlLs
         V2Y3ykL1otDd4UYg3AO1wCzFIenWWSMPlv5lM0QJhoM1QZ18GC0tga3DNKSk57/Vulsl
         1zUAzeuxlJyNJnavyu/hQcU7rmI4v/l0X/Mh4Btfcd67WhcWw7UYLtbKLfowFwGy9Bhs
         GwHgv4iUwyKXttYxR81lfvmvkzy1ybK541OANNwDCs1I+f34br5a8i+vLe4oFAFQw4hD
         aEfk/qKjxQPbHVck+cT3lUQ+W24U3p+YWhRw1Gf0F75l918JG+l/zfLhCRqUYfHQzUd/
         z3hQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20161025;
        h=x-gm-message-state:date:from:to:message-id:in-reply-to:references
         :subject:mime-version:x-original-sender:reply-to:precedence
         :mailing-list:list-id:x-spam-checked-in-group:list-post:list-help
         :list-archive:list-subscribe:list-unsubscribe;
        bh=BjyKabz9dUcPLbdwcogKwRIHHaAZkjO7UUjJ7xRUqdU=;
        b=bi5C8Nw5dgfcVxeN/cepQ5H/N9LtGqONXRmXfLzQ5/znQ4G5aEqQzXJM1wSKXDNgGg
         a0pniMdGk4naF3v/WDLTThVuw8N7W5OfbtcxQvh3HzwOLh/soCRNl3StDYbf8llrG4HY
         4WZIshmG8JW+8770LUnMuo+B8Xa2p9326Vas3Z1GPchheL4PVKJzw+bV+evFL0qyD3RE
         tfm3IUZCDdRQ5vG3IcA/mVxkb4of5HVzz50WL5nEYeq8le6Sis2RURE6Jxcy66k8zVCk
         lQlNVnwgddMBkdUCn3X1/AhkI2blA6HRuwf/vzpibCriyvYR3dudz0BalhuxhRsQRWIG
         Nkdg==
X-Gm-Message-State: AOUpUlFiSBoSZb5Qa6ShSnvL3uBrF90nzGvpQwwhhtjYHFTC5pnM5lS/
	QpOv1kzf6xsh0mAp2ndpW8ODeg==
X-Google-Smtp-Source: AAOMgpchfMv04sCmzDIS+PlchX6StaoFV2iXNntGKdz6W+SanHnoWr9IUgrwKh5tyVGo4PrtdJgEnA==
X-Received: by 2002:a0d:cc03:: with SMTP id o3-v6mr3540089ywd.89.1532332886705;
        Mon, 23 Jul 2018 01:01:26 -0700 (PDT)
X-BeenThere: std-proposals@isocpp.org
Original-Received: by 2002:a81:88c7:: with SMTP id y190-v6ls1253399ywf.28.gmail; Mon,
 23 Jul 2018 01:01:25 -0700 (PDT)
X-Received: by 2002:a81:78c6:: with SMTP id t189-v6mr237326ywc.7.1532332885560;
        Mon, 23 Jul 2018 01:01:25 -0700 (PDT)
In-Reply-To: <CALvx3hbfFAyh7twxd73DdPYXkrs8chxjsRL9kYzd5kk2VmgD1Q@mail.gmail.com>
X-Original-Sender: thomas.russell97@gmail.com
Precedence: list
Mailing-list: list std-proposals@isocpp.org; contact std-proposals+owners@isocpp.org
List-ID: <std-proposals.isocpp.org>
X-Spam-Checked-In-Group: std-proposals@isocpp.org
X-Google-Group-Id: 399137483710
List-Post: <https://groups.google.com/a/isocpp.org/group/std-proposals/post>, <mailto:std-proposals@isocpp.org>
List-Help: <https://support.google.com/a/isocpp.org/bin/topic.py?topic=25838>, <mailto:std-proposals+help@isocpp.org>
List-Archive: <https://groups.google.com/a/isocpp.org/group/std-proposals/>
List-Subscribe: <https://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>,
 <https://groups.google.com/a/isocpp.org/group/std-proposals/subscribe>
Xref: news.gmane.org gmane.comp.lang.c++.isocpp.proposals:39294
Archived-At: <http://permalink.gmane.org/gmane.comp.lang.c++.isocpp.proposals/39294>

------=_Part_7987_945385635.1532332884855
Content-Type: text/plain; charset="UTF-8"

The motivation is similar to having any standard type-erased facility; it gives a concrete interface that accepts an arbitrary set of classes that conform to the required concepts.

The closest existing parallel in the standard library is `std::function`, modelling the Callable concept.

Having such a facility as a vocabulary type provides various benefits over function templates accepting Callables:
- Reduced generated code-size (this can even go some way towards reducing the performance penalty).
- Works with the OOP paradigm (virtual functions cannot be function templates) 
- Reduced compile-time
- Can work across dynamically-linked library boundaries, providing the correctly corresponding build parameters are met. 

I think these are good motivations, but am interested to hear opposing opinions. 

-- 
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.
To view this discussion on the web visit https://groups.google.com/a/isocpp.org/d/msgid/std-proposals/c9664ef6-f769-4942-8e44-56761d091efc%40isocpp.org.

------=_Part_7987_945385635.1532332884855--

.
