220 5320 <CAFk2RUaJ8Dn1WdiXLYuJZJpcto4aBv38UGVZMYqUoFz_b8eJrQ@mail.gmail.com> article
Path: news.gmane.org!not-for-mail
From: Ville Voutilainen <ville.voutilainen@gmail.com>
Newsgroups: gmane.comp.lang.c++.isocpp.proposals
Subject: Re: Allowing any integral type as an argument for
 user defined literal operators
Date: Sun, 7 Jul 2013 00:17:35 +0300
Lines: 123
Approved: news@gmane.org
Message-ID: <CAFk2RUaJ8Dn1WdiXLYuJZJpcto4aBv38UGVZMYqUoFz_b8eJrQ@mail.gmail.com>
References: <80016e3a-2dc8-4887-b59b-a8aff20439e0@isocpp.org>
	<CAFk2RUaUCRdjxrpZ+JRRsa+gWwUH0yWCcNSkTFLyWpLo2-ukag@mail.gmail.com>
	<03a23bfd-10ab-40db-a7f9-3cbd177a2d52@isocpp.org>
Reply-To: std-proposals@isocpp.org
NNTP-Posting-Host: plane.gmane.org
Mime-Version: 1.0
Content-Type: multipart/alternative; boundary=047d7b6dcf5214ebb504e0de571a
X-Trace: ger.gmane.org 1373145460 26833 80.91.229.3 (6 Jul 2013 21:17:40 GMT)
X-Complaints-To: usenet@ger.gmane.org
NNTP-Posting-Date: Sat, 6 Jul 2013 21:17:40 +0000 (UTC)
To: std-proposals@isocpp.org
Original-X-From: std-proposals+bncBC5JHI7A7ALRB34S4KHAKGQELDEQ3RA@isocpp.org Sat Jul 06 23:17:39 2013
Return-path: <std-proposals+bncBC5JHI7A7ALRB34S4KHAKGQELDEQ3RA@isocpp.org>
Envelope-to: gclcip-std-proposals@m.gmane.org
Original-Received: from mail-yh0-f69.google.com ([209.85.213.69])
	by plane.gmane.org with esmtp (Exim 4.69)
	(envelope-from <std-proposals+bncBC5JHI7A7ALRB34S4KHAKGQELDEQ3RA@isocpp.org>)
	id 1UvZrM-0007Dm-QQ
	for gclcip-std-proposals@m.gmane.org; Sat, 06 Jul 2013 23:17:37 +0200
Original-Received: by mail-yh0-f69.google.com with SMTP id b12sf4288257yha.8
        for <gclcip-std-proposals@m.gmane.org>; Sat, 06 Jul 2013 14:17:36 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20120113;
        h=x-beenthere:mime-version:in-reply-to:references:date:message-id
         :subject:from:to:x-original-sender:x-original-authentication-results
         :reply-to:precedence:mailing-list:list-id:x-google-group-id
         :list-post:list-help:list-archive:list-subscribe:list-unsubscribe
         :content-type;
        bh=04rJMaICx6ThYyf/F9V8ZzvBLuWo99NmaFsRCE5g12A=;
        b=hE7z1YnabqTrQC1zE/Nx2mLKqjW9y03PLmYLAgDUsUCAA1PJOc3lud3MJ2z5Lf8Whe
         ZWj3uDMyQ0u7sbf0RYhd8RKdTZbNQpBjflcFl/z+FTz0C4poWLA1v4uuLaEBCnr2g8qo
         Ye8IA++kmA6RIXohLlDnshZlxgFhGJR9vVrkXtjqaSKXa7pLUK/6IoQtsyX7BISz5jCZ
         gneBSM4GT813qgh1VXjg9BrczYSltkaaPh7ZvMBtIW3kffQXlJVZ8qMAu+RwE9+nNsM2
         MnKaUv7VEgTZNyQd87UtBoBNlH+JX9N483AfzkfXpMyRvklKRple2tsGZciXiFnOtOsF
         RJmQ==
X-Received: by 10.224.29.76 with SMTP id p12mr18421008qac.5.1373145455746;
        Sat, 06 Jul 2013 14:17:35 -0700 (PDT)
X-BeenThere: std-proposals@isocpp.org
Original-Received: by 10.49.12.233 with SMTP id b9ls1392792qec.14.gmail; Sat, 06 Jul
 2013 14:17:35 -0700 (PDT)
X-Received: by 10.49.26.202 with SMTP id n10mr9587307qeg.60.1373145455363;
        Sat, 06 Jul 2013 14:17:35 -0700 (PDT)
Original-Received: from mail-qc0-x22c.google.com (mail-qc0-x22c.google.com [2607:f8b0:400d:c01::22c])
        by mx.google.com with ESMTPS id c9si3939087qac.92.2013.07.06.14.17.35
        for <std-proposals@isocpp.org>
        (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128);
        Sat, 06 Jul 2013 14:17:35 -0700 (PDT)
Received-SPF: pass (google.com: domain of ville.voutilainen@gmail.com designates 2607:f8b0:400d:c01::22c as permitted sender) client-ip=2607:f8b0:400d:c01::22c;
Original-Received: by mail-qc0-f172.google.com with SMTP id j10so1721501qcx.31
        for <std-proposals@isocpp.org>; Sat, 06 Jul 2013 14:17:35 -0700 (PDT)
X-Received: by 10.49.94.41 with SMTP id cz9mr9438277qeb.83.1373145455190; Sat,
 06 Jul 2013 14:17:35 -0700 (PDT)
Original-Received: by 10.224.52.71 with HTTP; Sat, 6 Jul 2013 14:17:35 -0700 (PDT)
In-Reply-To: <03a23bfd-10ab-40db-a7f9-3cbd177a2d52@isocpp.org>
X-Original-Sender: ville.voutilainen@gmail.com
X-Original-Authentication-Results: mx.google.com;       spf=pass (google.com:
 domain of ville.voutilainen@gmail.com designates 2607:f8b0:400d:c01::22c as
 permitted sender) smtp.mail=ville.voutilainen@gmail.com;       dkim=pass header.i=@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:5320
Archived-At: <http://permalink.gmane.org/gmane.comp.lang.c++.isocpp.proposals/5320>

--047d7b6dcf5214ebb504e0de571a
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

On 7 July 2013 00:15, Micha=C5=82 Dominiak <griwes@griwes.info> wrote:

>
> It's not supposed to take any integral types. The operator takes an
>> unsigned type because any negation
>> happens outside it. Since we already have such a restriction for the typ=
e
>> a literal operator accepts, it's
>> not a far stretch to have a further limitation. I wouldn't mind it
>> accepting any unsigned integral type,
>> but I don't see it a big deal that you have to have a certain signature
>> for a literal operator.
>>
>
> Ok, s/any/any unsigned/.
>
>
>> Not allowing multiple kinds of integral types as literal operator
>> parameters also avoid having
>> to deal with overload resolution for the literal operators, and not
>> allowing narrow types avoids
>> having to deal with narrowing conversions.
>>
>
> No-one says allowing any unsigned argument type would allow overloading (=
I
> think it would be a counter-feature, really). And since you know all the
> values passed to the operator at compile time, no narrowing would ever
> happen - just slap the user with an error about the value being to big fo=
r
> given type.
>
>
>
>
Ok, so any unsigned type, no overloading with multiple integral types, and
any narrowing is ill-formed. With
that recipe, I wouldn't mind seeing a proposal about this. I'm not going to
write one myself. I may be able to
present one if necessary.

--=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/.



--047d7b6dcf5214ebb504e0de571a
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><br><div class=3D"gmail_extra"><br><br><div class=3D"gmail=
_quote">On 7 July 2013 00:15, Micha=C5=82 Dominiak <span dir=3D"ltr">&lt;<a=
 href=3D"mailto:griwes@griwes.info" target=3D"_blank">griwes@griwes.info</a=
>&gt;</span> wrote:<br>
<blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1p=
x #ccc solid;padding-left:1ex"><br><div class=3D"im"><blockquote class=3D"g=
mail_quote" style=3D"margin:0;margin-left:0.8ex;border-left:1px #ccc solid;=
padding-left:1ex">
<div dir=3D"ltr"><div><div class=3D"gmail_quote"><div>It&#39;s not supposed=
 to take any integral types. The operator takes an unsigned type because an=
y negation<br>
</div><div>happens outside it. Since we already have such a restriction for=
 the type a literal operator accepts, it&#39;s<br>not a far stretch to have=
 a further limitation. I wouldn&#39;t mind it accepting any unsigned integr=
al type,<br>

but I don&#39;t see it a big deal that you have to have a certain signature=
 for a literal operator.<br></div></div></div></div></blockquote><div><br><=
/div></div><div>Ok, s/any/any unsigned/.=C2=A0</div><div class=3D"im"><div>=
=C2=A0</div>
<blockquote class=3D"gmail_quote" style=3D"margin:0;margin-left:0.8ex;borde=
r-left:1px #ccc solid;padding-left:1ex"><div dir=3D"ltr"><div><div class=3D=
"gmail_quote"><div></div><div>Not allowing multiple kinds of integral types=
 as literal operator parameters also avoid having<br>
</div>
<div>to deal with overload resolution for the literal operators, and not al=
lowing narrow types avoids<br>having to deal with narrowing conversions.<br=
></div></div></div></div></blockquote><div>=C2=A0<br></div></div><div>No-on=
e says allowing any unsigned argument type would allow overloading (I think=
 it would be a counter-feature, really). And since you know all the values =
passed to the operator at compile time, no narrowing would ever happen - ju=
st slap the user with an error about the value being to big for given type.=
</div>
<div class=3D"HOEnZb"><div class=3D"h5">

<p></p>

<br><br></div></div></blockquote><div><br></div><div>Ok, so any unsigned ty=
pe, no overloading with multiple integral types, and any narrowing is ill-f=
ormed. With<br></div><div>that recipe, I wouldn&#39;t mind seeing a proposa=
l about this. I&#39;m not going to write one myself. I may be able to<br>
present one if necessary. <br></div></div><br></div></div>

<p></p>

-- <br />
&nbsp;<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 std-proposals+unsubscribe@isocpp.org.<br />
To post to this group, send email to std-proposals@isocpp.org.<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 />
&nbsp;<br />
&nbsp;<br />

--047d7b6dcf5214ebb504e0de571a--

.
