220 19959 <1c31275e-3bac-4eb2-99cf-256b14e6f650@isocpp.org> article
Path: news.gmane.org!not-for-mail
From: NDos Dannyu <ndospark320@naver.com>
Newsgroups: gmane.comp.lang.c++.isocpp.proposals
Subject: Re: Address of a reference: determining the value
 category of what it refers?
Date: Fri, 21 Aug 2015 22:15:57 -0700 (PDT)
Lines: 121
Approved: news@gmane.org
Message-ID: <1c31275e-3bac-4eb2-99cf-256b14e6f650@isocpp.org>
References: <76fe342f-3342-4355-af20-1c41b21e54aa@isocpp.org> <3183929.eXnTES4BH3@tjmaciei-mobl4> <c817b9fc-7a99-44ec-96a0-97379d0f17a7@isocpp.org>
 <13312961.n5JFXrPRMR@tjmaciei-mobl4>
Reply-To: std-proposals@isocpp.org
NNTP-Posting-Host: plane.gmane.org
Mime-Version: 1.0
Content-Type: multipart/mixed; 
	boundary="----=_Part_537_790931100.1440220558026"
X-Trace: ger.gmane.org 1440220561 2379 80.91.229.3 (22 Aug 2015 05:16:01 GMT)
X-Complaints-To: usenet@ger.gmane.org
NNTP-Posting-Date: Sat, 22 Aug 2015 05:16:01 +0000 (UTC)
To: ISO C++ Standard - Future Proposals <std-proposals@isocpp.org>
Original-X-From: std-proposals+bncBCX7FRO67EHRBD4L4CXAKGQESWLB4EA@isocpp.org Sat Aug 22 07:16:01 2015
Return-path: <std-proposals+bncBCX7FRO67EHRBD4L4CXAKGQESWLB4EA@isocpp.org>
Envelope-to: gclcip-std-proposals@m.gmane.org
Original-Received: from mail-io0-f198.google.com ([209.85.223.198])
	by plane.gmane.org with esmtp (Exim 4.69)
	(envelope-from <std-proposals+bncBCX7FRO67EHRBD4L4CXAKGQESWLB4EA@isocpp.org>)
	id 1ZT19t-0006y6-4V
	for gclcip-std-proposals@m.gmane.org; Sat, 22 Aug 2015 07:16:01 +0200
Original-Received: by iodt126 with SMTP id t126sf157058739iod.0
        for <gclcip-std-proposals@m.gmane.org>; Fri, 21 Aug 2015 22:16:00 -0700 (PDT)
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20130820;
        h=x-gm-message-state:date:from:to:message-id:in-reply-to:references
         :subject:mime-version:content-type: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=O+xouClz0EV3089bshqf1ORvq0lUk5QS+Z7wqfsqLCc=;
        b=bR0v2meilgTDvixnYMziazDTbgPpakm9X/u0R71N9wwS3RwxHVriKy5n5uYyGy6JN3
         D7xR5V8TOuRm0SDBt6T1lWEHUSMQIiqDP4w9iuRex6Zp58QMJMRlxYekyWDD2v02RkIX
         DLofXRvR/qXJ4qHWM1UctYly2vEX0UfNYXYAakukj2F0W2dkdfDwZfscVWqKQYh+Kjxh
         pcQR6ZBJaCOMSlCRt6+2zorfNOgWto2UTLNf/D8fk1m3Cygr8JSoCj1hlPZCZ8+LGWId
         JedX7eEpiR2uH9wiR5MU6VqCyke22Ihk6ltrIHcM5J3ZOBuTSaTmwluYQ4mkcNPDbGNo
         bcfQ==
X-Gm-Message-State: ALoCoQlkWJm/KjUmt+Da3vzIzqiNmz+rcssN+o8KcisvOnZrhhqUbzkeXvYlvECq8/xncMKK0NPR
X-Received: by 10.107.132.148 with SMTP id o20mr9608329ioi.31.1440220560200;
        Fri, 21 Aug 2015 22:16:00 -0700 (PDT)
X-BeenThere: std-proposals@isocpp.org
Original-Received: by 10.50.176.200 with SMTP id ck8ls683346igc.34.canary; Fri, 21 Aug
 2015 22:15:59 -0700 (PDT)
X-Received: by 10.50.32.8 with SMTP id e8mr125857igi.8.1440220559510;
        Fri, 21 Aug 2015 22:15:59 -0700 (PDT)
In-Reply-To: <13312961.n5JFXrPRMR@tjmaciei-mobl4>
X-Original-Sender: ndospark320@naver.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: <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: <mailto:googlegroups-manage+399137483710+unsubscribe@googlegroups.com>,
 <http://groups.google.com/a/isocpp.org/group/std-proposals/subscribe>
Xref: news.gmane.org gmane.comp.lang.c++.isocpp.proposals:19959
Archived-At: <http://permalink.gmane.org/gmane.comp.lang.c++.isocpp.proposals/19959>

------=_Part_537_790931100.1440220558026
Content-Type: multipart/alternative; 
	boundary="----=_Part_538_1646266657.1440220558026"

------=_Part_538_1646266657.1440220558026
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable



2015=EB=85=84 8=EC=9B=94 22=EC=9D=BC =ED=86=A0=EC=9A=94=EC=9D=BC =EC=98=A4=
=ED=9B=84 1=EC=8B=9C 6=EB=B6=84 29=EC=B4=88 UTC+9, Thiago Macieira =EB=8B=
=98=EC=9D=98 =EB=A7=90:
>
>
> What's is P and what is squaring the variable here? How should I interpre=
t=20
> the=20
> equal sign above?=20
>
P is probability function. It calculates the probability that the=20
expression inside is true.
For example:
    *#include <random>*
    *discrete_random_variable<int>=20
X(std::uniform_int_distribution<int>(1,6));*
This is a variable that represents a die.
P(X=3D1) =3D 1/6, P(X=3D2) =3D 1/6, ... , P(X=3D6) =3D 1/6.
But what would P(X=3DX) be?
Of course a die will always be same number with itself, so P(X=3DX) =3D 1.=
=20
But...
    *discrete_random_variable<int> Y(X);*
This is a copy of X. Now I have two dice.
Even Y is a perfect copy of X, the dice are different.
P(X=3DY) =3D 1/6.
Of course, C++ uses =3D=3D as equality, and C++ can't compare three or more=
=20
elements at once.
So, the expression P(X<X=C2=B2=3DY>|Z|) would be written in C++ as somethin=
g like=20
this:
    *compare(And{{X, std::less, bind_variable(std::pow, X, 2)}, {**bind_var=
iable(std::pow,=20
X, 2), std::equal, Y}, {Y, std::greater, bind_variable(std::abs, Z)}});*
What a mess.

>
> You cannot.=20
>
That was harsh... >_> Maybe I should use pointers instead, as David Krauss=
=20
pointed it. Thank you David Krauss.

--=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/.

------=_Part_538_1646266657.1440220558026
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><br><br>2015=EB=85=84 8=EC=9B=94 22=EC=9D=BC =ED=86=A0=EC=
=9A=94=EC=9D=BC =EC=98=A4=ED=9B=84 1=EC=8B=9C 6=EB=B6=84 29=EC=B4=88 UTC+9,=
 Thiago Macieira =EB=8B=98=EC=9D=98 =EB=A7=90:<blockquote class=3D"gmail_qu=
ote" style=3D"margin: 0px 0px 0px 0.8ex; padding-left: 1ex; border-left-col=
or: rgb(204, 204, 204); border-left-width: 1px; border-left-style: solid;">=
<br>What&#39;s is P and what is squaring the variable here? How should I in=
terpret the=20
<br>equal sign above?
<br></blockquote><div>P is probability function. It calculates the probabil=
ity that the expression inside=C2=A0is true.</div><div>For example:</div><d=
iv>=C2=A0=C2=A0=C2=A0 <strong>#include &lt;random&gt;</strong></div><div>=
=C2=A0=C2=A0=C2=A0 <strong>discrete_random_variable&lt;int&gt; X(std::unifo=
rm_int_distribution&lt;int&gt;(1,6));</strong></div><div>This is a variable=
 that represents a die.</div><div>P(X=3D1)=C2=A0=3D 1/6, P(X=3D2) =3D 1/6, =
.... , P(X=3D6) =3D 1/6.</div><div>But what would P(X=3DX) be?</div><div>Of =
course a die will always be same number with itself, so P(X=3DX) =3D 1. But=
....</div><div>=C2=A0=C2=A0=C2=A0 <strong>discrete_random_variable&lt;int&gt=
; Y(X);</strong></div><div>This is a copy of X. Now I have two dice.</div><=
div>Even Y is a perfect copy of X, the dice are different.</div><div>P(X=3D=
Y) =3D 1/6.</div><div>Of course, C++ uses =3D=3D as equality, and C++ can&#=
39;t compare three or more elements at once.</div><div>So, the expression P=
(X&lt;X=C2=B2=3DY&gt;|Z|) would be written=C2=A0in C++=C2=A0as something=C2=
=A0like this:</div><div>=C2=A0=C2=A0=C2=A0 <strong>compare(And{{X, std::les=
s, bind_variable(std::pow, X, 2)}, {</strong><strong>bind_variable(std::pow=
, X, 2), std::equal, Y}, {Y, std::greater, bind_variable(std::abs, Z)}});</=
strong></div><div>What a mess.</div><blockquote class=3D"gmail_quote" style=
=3D"margin: 0px 0px 0px 0.8ex; padding-left: 1ex; border-left-color: rgb(20=
4, 204, 204); border-left-width: 1px; border-left-style: solid;"><br>You ca=
nnot.
<br></blockquote><div>That was harsh... &gt;_&gt; Maybe I should use pointe=
rs instead, as David=C2=A0Krauss pointed it. Thank you David Krauss.</div><=
/div>

<p></p>

-- <br />
<br />
--- <br />
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals&quot; group.<br />
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to <a href=3D"mailto:std-proposals+unsubscribe@isocpp.org">std-proposa=
ls+unsubscribe@isocpp.org</a>.<br />
To post to this group, send email to <a href=3D"mailto:std-proposals@isocpp=
..org">std-proposals@isocpp.org</a>.<br />
Visit this group at <a href=3D"http://groups.google.com/a/isocpp.org/group/=
std-proposals/">http://groups.google.com/a/isocpp.org/group/std-proposals/<=
/a>.<br />

------=_Part_538_1646266657.1440220558026--
------=_Part_537_790931100.1440220558026--

.
