220 19958 <13312961.n5JFXrPRMR@tjmaciei-mobl4> article
Path: news.gmane.org!not-for-mail
From: Thiago Macieira <thiago@macieira.org>
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 21:06:23 -0700
Lines: 78
Approved: news@gmane.org
Message-ID: <13312961.n5JFXrPRMR@tjmaciei-mobl4>
References: <76fe342f-3342-4355-af20-1c41b21e54aa@isocpp.org> <3183929.eXnTES4BH3@tjmaciei-mobl4> <c817b9fc-7a99-44ec-96a0-97379d0f17a7@isocpp.org>
Reply-To: std-proposals@isocpp.org
NNTP-Posting-Host: plane.gmane.org
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable
X-Trace: ger.gmane.org 1440216395 10806 80.91.229.3 (22 Aug 2015 04:06:35 GMT)
X-Complaints-To: usenet@ger.gmane.org
NNTP-Posting-Date: Sat, 22 Aug 2015 04:06:35 +0000 (UTC)
To: std-proposals@isocpp.org
Original-X-From: std-proposals+bncBCB4TK757YBRBRHK36XAKGQEMIJW7RA@isocpp.org Sat Aug 22 06:06:30 2015
Return-path: <std-proposals+bncBCB4TK757YBRBRHK36XAKGQEMIJW7RA@isocpp.org>
Envelope-to: gclcip-std-proposals@m.gmane.org
Original-Received: from mail-lb0-f199.google.com ([209.85.217.199])
	by plane.gmane.org with esmtp (Exim 4.69)
	(envelope-from <std-proposals+bncBCB4TK757YBRBRHK36XAKGQEMIJW7RA@isocpp.org>)
	id 1ZT04b-0000kF-Hh
	for gclcip-std-proposals@m.gmane.org; Sat, 22 Aug 2015 06:06:29 +0200
Original-Received: by lbbpd10 with SMTP id pd10sf25476718lbb.3
        for <gclcip-std-proposals@m.gmane.org>; Fri, 21 Aug 2015 21:06:29 -0700 (PDT)
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20130820;
        h=x-gm-message-state:from:to:subject:date:message-id:user-agent
         :in-reply-to:references:mime-version:content-transfer-encoding
         :content-type: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=qrXBsRYNGKNmNZ74clX8BwdewnQeZ8SOTvOLGIEuXjI=;
        b=mlI3EfSReYBXLR2IzoxC/I3WbUUsxPhR7PQzy0SYTVIPViM3BCUYOFgxW5QdWAyxRe
         w2ak67U7wf6+F/32GTsCm185COkzuLJTcXIl8Nf90cJUESIxtVJhPIb+LFoNXP+ffjEN
         IknLFgZ2vs8VwYMzUx5qZjPQ8tnLzA559sqpfHlAZ0muXOqBb6/RgsVeOZ1SjM2cNJQc
         u7WxjNPxNcLKqOggRLhj1XLIshBEJM5lFvjSFnZoSZEfzxW+a0joAoXZ2OIoW7oVQSU7
         upslVlac1FHhMc77L6ChrQvvDToKiiLziijHKkzKlzRifeHl685hM20Y4 
X-Gm-Message-State: ALoCoQl3G9wVK/wTRZapjDJmpdon6+BhRZA39J7Y4Jhs8wQflY+5qOixHRav+bpxdo1AERzxovKk
X-Received: by 10.112.173.230 with SMTP id bn6mr3250838lbc.15.1440216389176;
        Fri, 21 Aug 2015 21:06:29 -0700 (PDT)
X-BeenThere: std-proposals@isocpp.org
Original-Received: by 10.180.100.227 with SMTP id fb3ls473357wib.23.canary; Fri, 21 Aug
 2015 21:06:28 -0700 (PDT)
X-Received: by 10.180.105.36 with SMTP id gj4mr11637175wib.64.1440216388154;
        Fri, 21 Aug 2015 21:06:28 -0700 (PDT)
Original-Received: from gondolin.macieira.info (gondolin.macieira.info. [2a01:4f8:d13:f81:21c:14ff:fe01:12a3])
        by mx.google.com with ESMTP id gy1si2873563wib.1.2015.08.21.21.06.27
        for <std-proposals@isocpp.org>;
        Fri, 21 Aug 2015 21:06:27 -0700 (PDT)
Received-SPF: pass (google.com: domain of thiago@macieira.org designates 2a01:4f8:d13:f81:21c:14ff:fe01:12a3 as permitted sender) client-ip=2a01:4f8:d13:f81:21c:14ff:fe01:12a3;
Original-Received: from tjmaciei-mobl4.localnet (unknown [IPv6:2601:1c0:5803:81c9:40d2:14bc:2276:38b6])
	by gondolin.macieira.info (Postfix) with ESMTPSA id E677211A7D6
	for <std-proposals@isocpp.org>; Fri, 21 Aug 2015 21:06:25 -0700 (PDT)
User-Agent: KMail/4.14.9 (Linux/4.1.3-1-desktop; KDE/4.14.9; x86_64; ; )
In-Reply-To: <c817b9fc-7a99-44ec-96a0-97379d0f17a7@isocpp.org>
X-Original-Sender: thiago@macieira.org
X-Original-Authentication-Results: mx.google.com;       spf=pass (google.com:
 domain of thiago@macieira.org designates 2a01:4f8:d13:f81:21c:14ff:fe01:12a3
 as permitted sender) smtp.mailfrom=thiago@macieira.org
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:19958
Archived-At: <http://permalink.gmane.org/gmane.comp.lang.c++.isocpp.proposals/19958>

On Friday 21 August 2015 19:42:13 NDos Dannyu wrote:
> 2015=EB=85=84 8=EC=9B=94 22=EC=9D=BC =ED=86=A0=EC=9A=94=EC=9D=BC =EC=98=
=A4=EC=A0=84 11=EC=8B=9C 24=EB=B6=84 55=EC=B4=88 UTC+9, Thiago Macieira =EB=
=8B=98=EC=9D=98 =EB=A7=90:
> > You're saying that the function doit above should return null if it was
> > called
> > with a reference to a temporary. But if it does so, how will it print t=
he
> > value that was referenced?
>=20
> Does printf need its address??

No. The point is that the function "doit" needs to know how to obtain the=
=20
value, regardless of whether it's a reference to a temporary or a reference=
 to=20
something more permanent.

> > Besides, we're missing an important aspect: why do you want this? What'=
s
> > the
> > motivation?
>=20
> I'm writing my story again:
>=20
> I have a value class indicating a finite discrete random variable.
> But I had a problem. For example, assume that I have a variable named X.
> But how can P(X<X=C2=B2) interpreted? X is still X, even it is squared, i=
sn't it?
> Things will get much more complicated if I have multiple variables, X, Y
> and Z,
> and I have to do like P(X<X=C2=B2=3DY>|Z|) or something.

What's is P and what is squaring the variable here? How should I interpret =
the=20
equal sign above?

> So I decided to make a bind of variables.
> It would be a tree structure, consisting of other binds or variables.
> If it consists of references of variables, it will know what variables ar=
e
> same(or dependant) and what variables are different(or indepentant).
> But how can I deal with rvalues? For examples, 1 can be seen as a variabl=
e
> which is always 1.

Correct.

> But it has no name. It is just 1. It is always indepentant from
> other variables.

Right. It may also be different from other 1s.

> So I made it to consist of const lvalue references,
> which can initialized with lvalue or rvalue.
> But how can I determine it refers to lvalue or rvalue?? I couldn't find a=
ny
> solution from the standard library.

You cannot.

--=20
Thiago Macieira - thiago (AT) macieira.info - thiago (AT) kde.org
   Software Architect - Intel Open Source Technology Center
      PGP/GPG: 0x6EF45358; fingerprint:
      E067 918B B660 DBD1 105C  966C 33F5 F005 6EF4 5358

--=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/.

.
