220 41552 <CAGNvRgCNM+4kcz2hXOKh-z_oRzvt6ehZN=_4J=xmoD9CyBhO5w@mail.gmail.com> article
Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail
From: =?UTF-8?Q?Daniel_Kr=C3=BCgler?= <daniel.kruegler@gmail.com>
Newsgroups: gmane.comp.lang.c++.isocpp.proposals
Subject: Re: Add is_empty
Date: Tue, 12 Mar 2019 19:32:56 +0100
Approved: news@gmane.org
Message-ID: <CAGNvRgCNM+4kcz2hXOKh-z_oRzvt6ehZN=_4J=xmoD9CyBhO5w@mail.gmail.com>
References: <ee9b4876-3e40-417c-a460-347fa83871ce@isocpp.org>
Reply-To: std-proposals@isocpp.org
Mime-Version: 1.0
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226";
	logging-data="225988"; mail-complaints-to="usenet@blaine.gmane.org"
To: std-proposals@isocpp.org
Original-X-From: std-proposals+bncBCT7RVFA4QORBXXWT7SAKGQEQNJ3ZUY@isocpp.org Tue Mar 12 19:33:06 2019
Return-path: <std-proposals+bncBCT7RVFA4QORBXXWT7SAKGQEQNJ3ZUY@isocpp.org>
Envelope-to: gclcip-std-proposals@m.gmane.org
Original-Received: from mail-lj1-f199.google.com ([209.85.208.199])
	by blaine.gmane.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128)
	(Exim 4.89)
	(envelope-from <std-proposals+bncBCT7RVFA4QORBXXWT7SAKGQEQNJ3ZUY@isocpp.org>)
	id 1h3mD2-000waZ-4q
	for gclcip-std-proposals@m.gmane.org; Tue, 12 Mar 2019 19:33:04 +0100
Original-Received: by mail-lj1-f199.google.com with SMTP id t9sf827382lji.0
        for <gclcip-std-proposals@m.gmane.org>; Tue, 12 Mar 2019 11:33:04 -0700 (PDT)
ARC-Seal: i=2; a=rsa-sha256; t=1552415583; cv=pass;
        d=google.com; s=arc-20160816;
        b=bvMUqcdaLMeHbnxEjObyz7MOey88FUC4WSnYPdsk9/Ltw8Pcz/nfVfhp3RVWPTudwp
         0kCobmxoqj2B10w8szqwPG2lTvzUVKbz6EpjAVg5gw8/IGiB+95kNFTzG7C4inEz8GAK
         w30mTesnNUY1loOEZmRQFlYBjj3oZTQ8/S2VF7PTQoX97uccLrc1zMi0+sIzHBzwVZ2B
         4k/02MUrvpRzQoptYPKVvnfkg1smn5VoY9r9pWFFKlCYAgV4WC5JoKgfT8xmxevtsisW
         QpnvWpHfDZkLvfRgcLZ1zW5qgivFe893TEhGaFd/HhgpmoAret6UqhS7ZCEjK+nUC4Ut
         hrIg==
ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816;
        h=list-unsubscribe:list-subscribe:list-archive:list-help:list-post
         :list-id:mailing-list:precedence:reply-to:content-transfer-encoding
         :to:subject:message-id:date:from:in-reply-to:references:mime-version
         :dkim-signature;
        bh=X6abgqjegKwCuwiVuHsQM+2FWnOOy+dc7csW7vkV+Ow=;
        b=o/m5l/ijKzZqMImLlibtGmzpsd4X7CN8SPzWQCJjtx95emVgB/M4PdzYDuchnBdsjo
         TBVXei84kXwI++lr3SliplbqLNFsEgK6BpvZlwQBrSlj0vHvq6jiCI/c/L6HDkN3de5k
         QlTwI2vgFVqQcrNiq8AnbrmuC1cDJZ2Rt+vjw82kzVeSV+CoqJhrD4cJQjBlq3URQ2mp
         W1103oLVQtmYtoQU4+SWb+pkWFhky2iWIQth01vOlO50PjCe8Xcc8T/6denzCXoCwEFU
         uzhlUaDasHFIHd+CgiJC32EPBmoHZfkRjxlPYupH675JdAK7facl7buqOztwlvdpqIsZ
         r8VA==
ARC-Authentication-Results: i=2; mx.google.com;
       dkim=pass header.i=@gmail.com header.s=20161025 header.b="ibBhXm/n";
       spf=pass (google.com: domain of daniel.kruegler@gmail.com designates 209.85.220.41 as permitted sender) smtp.mailfrom=daniel.kruegler@gmail.com;
       dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=isocpp-org.20150623.gappssmtp.com; s=20150623;
        h=mime-version:references:in-reply-to:from:date:message-id:subject:to
         :content-transfer-encoding:x-original-sender
         :x-original-authentication-results:reply-to:precedence:mailing-list
         :list-id:list-post:list-help:list-archive:list-subscribe
         :list-unsubscribe;
        bh=X6abgqjegKwCuwiVuHsQM+2FWnOOy+dc7csW7vkV+Ow=;
        b=N6K6kxgpzEzmLuSBpe/t7VYvPhk+dpYFLkwYn7EqOxGul94DUl/6YRXe/RDV1zNCFV
         wEgE3FBww3qESZapOD1zrGaa+95UCKEG9BNyQuc5xDEKbg4+K9XLKcSXrYh5uAGeYoaG
         2ClFpK0bBpSwwSyCG8IYvibSH4CM+Z4/Y0edrWfyK/MEI537kgTbJf10ZxzE8XhHw7bl
         fP/86r+V9qywIe3fcEI6oTQCHpdvgt8wNql1RbCyIsHLFk0q3tIPc+4gxE9VsGg+ZvuM
         nC6aITeulF5qaUW1Hhrg5mC8XTkMtu+JG3H4pzn3B2T1y3NYdtceF0ujrKufSavGAt8j
         Ej/Q==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20161025;
        h=x-gm-message-state:mime-version:references:in-reply-to:from:date
         :message-id:subject:to:content-transfer-encoding:x-original-sender
         :x-original-authentication-results:reply-to:precedence:mailing-list
         :list-id:x-spam-checked-in-group:list-post:list-help:list-archive
         :list-subscribe:list-unsubscribe;
        bh=X6abgqjegKwCuwiVuHsQM+2FWnOOy+dc7csW7vkV+Ow=;
        b=j3NhK2a1a99igsKD+GPqYaIe21wqFhGfpbA9vbszmqW499/j1fQ4unn+O3LrmZ50YF
         MjafAtMJjHtFPUrV+nOOhQPEoG/jZFM+VVZyQq8+VoiYr/O1AKIEGQZlL+6vbH+LnuEz
         WjgKp3b0QOUMhj7sWUW36l2SyKpqwFPI2zVgfzehKByv1nqhkTPiE2vkLXxzaWyHxsED
         RYeu0tiqd96K43X62Kf89F3UHtZH1XFxVl/yIiwHOzkAaNYhd7R+kL6ND8uxSrdyEGr9
         RQLKKGmZzPtBK5748F8ned9zIASUAa23JIYxEOGwrrUny1wVUyUQiZP9q8XbpikfiTGe
         QIM 
X-Gm-Message-State: APjAAAUuC0pGwBV/YWKbuGqlDE4c6GV/tl6J7BmeVPGRH19CVKwat0Ku
	2/74vJHu3uDleTxCAftxXC3XGQ==
X-Google-Smtp-Source: APXvYqwLQ3/VJjKgbD4ITotuS3MmMrDzhoU/l6bDm3bTBYQ77tdflEHtV5+eB8CLbH32Trk+jZTWGA==
X-Received: by 2002:a2e:8616:: with SMTP id a22mr128336lji.26.1552415583681;
        Tue, 12 Mar 2019 11:33:03 -0700 (PDT)
X-BeenThere: std-proposals@isocpp.org
Original-Received: by 2002:ac2:5289:: with SMTP id q9ls718979lfm.2.gmail; Tue, 12 Mar
 2019 11:33:00 -0700 (PDT)
X-Received: by 2002:a19:1f8a:: with SMTP id f132mr21345104lff.143.1552415580515;
        Tue, 12 Mar 2019 11:33:00 -0700 (PDT)
ARC-Seal: i=1; a=rsa-sha256; t=1552415580; cv=none;
        d=google.com; s=arc-20160816;
        b=be7uxJO2VceuzwJLZRgHbiBcPZlaDyqIjOGd0Fk/2C9yiF0Zgn+dtL1ZK6n7+Inl76
         8euNtm89IQ9wOZ3NFTM5FKspccLE5pB1ldfdw19xPLEMIn7hzrnKhP6vQpFLLwO1ibJ4
         7Q4TH9HldMgOmWakN0LlGAjB+I1WuZxRPJpUVSPwkPCqPMrSGDNDJm0HwNFIDQGKvQkr
         lfKhPGMcibPD65h5ygcEI+WJuokYXTBeficrnF2F/ta23QVGI5HQVmDh5r940t7qTH9a
         w5TgkJjupr4N24j7Zb6SeqA0pWZDn1OdvrPBWuhPzNISxIze3o+n3Wjn3Qt3yUuzbz1e
         K53w==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816;
        h=content-transfer-encoding:to:subject:message-id:date:from
         :in-reply-to:references:mime-version:dkim-signature;
        bh=RvWKN0wimqCAQNStaehJy3I2jJPhCgZ0tdsQB6pTXfg=;
        b=jbesWSZorj/A+CKGdT1vUcnJpXpjKKTqufI8CW1O+xtGHBxOV1srSG30+9rhTctTv1
         zbi3ls8rAeb1cEFJruNd21UQp7CjP78TJvAo6L0aElmRV91M3MysnD+AGnhWCINbmzF3
         xXjDhx9MF35ztrad2kmDrRU62DtT53SCnFGTOtcIOYsid7yQTj9ylE7Qx+fw6G8lA1N7
         54wM7Jm+Y0RVgrFxxyfVttgifMAqq4ZFjPh0BReHIePD/4IhRVyjzXj5X1IOQnejh6qs
         rZuojE1tH2fi8m+ahUxVVpMr+BeUMmv5VSdOQulyrCYP/vVeo2xONumjMBfccTSZS0u+
         592A==
ARC-Authentication-Results: i=1; mx.google.com;
       dkim=pass header.i=@gmail.com header.s=20161025 header.b="ibBhXm/n";
       spf=pass (google.com: domain of daniel.kruegler@gmail.com designates 209.85.220.41 as permitted sender) smtp.mailfrom=daniel.kruegler@gmail.com;
       dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com
Original-Received: from mail-sor-f41.google.com (mail-sor-f41.google.com. [209.85.220.41])
        by mx.google.com with SMTPS id e9sor5605905ljk.10.2019.03.12.11.33.00
        for <std-proposals@isocpp.org>
        (Google Transport Security);
        Tue, 12 Mar 2019 11:33:00 -0700 (PDT)
Received-SPF: pass (google.com: domain of daniel.kruegler@gmail.com designates 209.85.220.41 as permitted sender) client-ip=209.85.220.41;
X-Received: by 2002:a2e:5715:: with SMTP id l21mr4125881ljb.105.1552415579995;
 Tue, 12 Mar 2019 11:32:59 -0700 (PDT)
In-Reply-To: <ee9b4876-3e40-417c-a460-347fa83871ce@isocpp.org>
X-Original-Sender: daniel.kruegler@gmail.com
X-Original-Authentication-Results: mx.google.com;       dkim=pass
 header.i=@gmail.com header.s=20161025 header.b="ibBhXm/n";       spf=pass
 (google.com: domain of daniel.kruegler@gmail.com designates 209.85.220.41 as
 permitted sender) smtp.mailfrom=daniel.kruegler@gmail.com;       dmarc=pass
 (p=NONE sp=QUARANTINE 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: <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:41552
Archived-At: <http://permalink.gmane.org/gmane.comp.lang.c++.isocpp.proposals/41552>

Am Di., 12. M=C3=A4rz 2019 um 19:17 Uhr schrieb <joewoodbury@gmail.com>:
>
> The one thing that has irritated me the most with the standard library is=
 using ::empty() instead of ::is_empty(). Is there a possibility of adding =
is_empty() to every class using empty()?
>

I don't consider that as a viable option:

1) An API that provides both "empty" and "is_empty" is confusing: Does
"empty" means something different? In addition: This is not really new
functionality, it is just selling existing functionality under a new
name.
2) Albeit the current Container requirements are actual tables that
are intended to simplify the Standard C++ Library specification, many
programmers in the world do consider them as kind of concepts and this
means that you break existing libraries providing a "Standard
Container" type which don't provide yet both empty() and is_empty()
3) Why should we modify a bunch of types in the standard, if we could
just provide a single _free_ function template? Problem is: We already
have such a single free function "empty" ;-)

My recommendation is: Why don't you define your own free function
template is_empty (similar to the free function "empty" as described
by (3)) that delegates either to std::empty() or that implements an
even simpler protocol (Such as that it participates in overload
resolution when x.empty() is valid for some const object x of type X)?

- Daniel

--=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.
To view this discussion on the web visit https://groups.google.com/a/isocpp=
..org/d/msgid/std-proposals/CAGNvRgCNM%2B4kcz2hXOKh-z_oRzvt6ehZN%3D_4J%3Dxmo=
D9CyBhO5w%40mail.gmail.com.

.
