220 9434 <4794DEE7-D64D-42E3-990C-95C49F2919A6@gmail.com> article
Path: news.gmane.org!not-for-mail
From: Nicola Gigante <nicola.gigante@gmail.com>
Newsgroups: gmane.comp.lang.c++.isocpp.proposals
Subject: Re: Re: Allowing overloadable operators to be
 implemented as non-member functions
Date: Tue, 25 Feb 2014 10:28:35 +0100
Lines: 37
Approved: news@gmane.org
Message-ID: <4794DEE7-D64D-42E3-990C-95C49F2919A6@gmail.com>
References: <72c8d66b-9053-455d-8af4-96191d84b0cd@isocpp.org> <69a7690f-632f-4ac3-ad76-b56ac59d51f1@isocpp.org> <24fcdc41-d0e1-4641-acb8-e9533ff3ac88@isocpp.org> <7088ca90-6da2-402c-966c-9f7838e5d05c@isocpp.org> <0e40f63d-9a5a-4f55-84a4-abb658da7537@isocpp.org>
Reply-To: std-proposals@isocpp.org
NNTP-Posting-Host: plane.gmane.org
Mime-Version: 1.0 (1.0)
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
X-Trace: ger.gmane.org 1393320519 7155 80.91.229.3 (25 Feb 2014 09:28:39 GMT)
X-Complaints-To: usenet@ger.gmane.org
NNTP-Posting-Date: Tue, 25 Feb 2014 09:28:39 +0000 (UTC)
To: "std-proposals@isocpp.org" <std-proposals@isocpp.org>
Original-X-From: std-proposals+bncBDMMZOF5V4KBBTOEWGMAKGQERWVVDUA@isocpp.org Tue Feb 25 10:28:47 2014
Return-path: <std-proposals+bncBDMMZOF5V4KBBTOEWGMAKGQERWVVDUA@isocpp.org>
Envelope-to: gclcip-std-proposals@m.gmane.org
Original-Received: from mail-wi0-f198.google.com ([209.85.212.198])
	by plane.gmane.org with esmtp (Exim 4.69)
	(envelope-from <std-proposals+bncBDMMZOF5V4KBBTOEWGMAKGQERWVVDUA@isocpp.org>)
	id 1WIEJj-00080h-21
	for gclcip-std-proposals@m.gmane.org; Tue, 25 Feb 2014 10:28:47 +0100
Original-Received: by mail-wi0-f198.google.com with SMTP id cc10sf771533wib.9
        for <gclcip-std-proposals@m.gmane.org>; Tue, 25 Feb 2014 01:28:46 -0800 (PST)
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20130820;
        h=x-gm-message-state:subject:references:from:in-reply-to:message-id
         :date:to:mime-version: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=CjfbJzHGfod1KaZDVObSnJUTp3ffmzccS3GMuHpG1fI=;
        b=ZotBlpSyVH+g5CD0mmwjwoNV+zU0Ru1xim20xV/UBs4ayFgAQg0Sv1g9hIq+7PYNKT
         Rb4u46SIgCmMsUm6jZu5Wb+za7Ld3MRGGD2HZnsUTLQNVDRCInrsP5CUKjT23bPyqrgT
         Qzouhb/5Wy0Kz1lpfcX/D1DWDv7DAVWAY38fVF09QIdRe30f9OVYKyk4/6jMZfIkNogb
         GtmkQzb96AyLfX25nSTnbxYfg+JJ3ILrfNmoLBQm/dAM3WQExO8blGl0SmkJgTWkSl+B
         kanegsxaFak/OP8Dx2Q9wNOYF2uZ3IleAztDpnds6Oos88QB4MhLgosM842zN0nDO6lN
         rlsQ==
X-Gm-Message-State: ALoCoQlTrxretA8eIgkrD8U5aC9YXgbPFN3yrEtKJfzCS/nZVyiRcOO5VTXWUDHsyINPE7SOCX55
X-Received: by 10.180.80.70 with SMTP id p6mr926255wix.4.1393320526588;
        Tue, 25 Feb 2014 01:28:46 -0800 (PST)
X-BeenThere: std-proposals@isocpp.org
Original-Received: by 10.180.19.227 with SMTP id i3ls590592wie.37.gmail; Tue, 25 Feb
 2014 01:28:45 -0800 (PST)
X-Received: by 10.180.7.130 with SMTP id j2mr18224837wia.25.1393320525203;
        Tue, 25 Feb 2014 01:28:45 -0800 (PST)
Original-Received: from mail-wi0-x22b.google.com (mail-wi0-x22b.google.com [2a00:1450:400c:c05::22b])
        by mx.google.com with ESMTPS id kr10si17300199wjc.156.2014.02.25.01.28.45
        for <std-proposals@isocpp.org>
        (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128);
        Tue, 25 Feb 2014 01:28:45 -0800 (PST)
Received-SPF: pass (google.com: domain of nicola.gigante@gmail.com designates 2a00:1450:400c:c05::22b as permitted sender) client-ip=2a00:1450:400c:c05::22b;
Original-Received: by mail-wi0-f171.google.com with SMTP id cc10so4125377wib.16
        for <std-proposals@isocpp.org>; Tue, 25 Feb 2014 01:28:45 -0800 (PST)
X-Received: by 10.180.98.71 with SMTP id eg7mr1546159wib.31.1393320525008;
        Tue, 25 Feb 2014 01:28:45 -0800 (PST)
Original-Received: from [10.231.5.225] ([90.174.1.91])
        by mx.google.com with ESMTPSA id ga20sm32290761wic.0.2014.02.25.01.28.37
        for <std-proposals@isocpp.org>
        (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128);
        Tue, 25 Feb 2014 01:28:43 -0800 (PST)
X-Mailer: iPhone Mail (11B554a)
In-Reply-To: <0e40f63d-9a5a-4f55-84a4-abb658da7537@isocpp.org>
X-Original-Sender: nicola.gigante@gmail.com
X-Original-Authentication-Results: mx.google.com;       spf=pass (google.com:
 domain of nicola.gigante@gmail.com designates 2a00:1450:400c:c05::22b as
 permitted sender) smtp.mail=nicola.gigante@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:9434
Archived-At: <http://permalink.gmane.org/gmane.comp.lang.c++.isocpp.proposals/9434>



> Il giorno 22/feb/2014, alle ore 06:21, myriachan@gmail.com ha scritto:
> In other words, have the compiler generate lambdas for the expressions on=
 the left and right sides of the colon, and try to find an operator ?: func=
tion that has an overload that will take that argument trio.
>=20

Why not address the problem more generally? Other languages just have a "la=
zy" keyword for function argument to enable lazy evaluation. That turns the=
 parameter into an implicit nullary lambda that returns the specified type.=
 This would address the problem of operator&& and every other operator like=
 that, basically the same way of functional languages like Haskell:

bool operator&&(lazy bool lhs, lazy bool rhs) { return lhs && rhs; }

I suppose the right semantics would be that, if evaluated, the arguments si=
de effects are evaluated once, so the code inside the function can use the =
variable how many times it wants without re-executing the underlying lambda=
..=20

Of course, lazy function parameters have a _lot_ of other applications, and=
 such a feature would merit a separate discussion.

> Melissa

--=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/.

.
