Fri Dec 6 15:05:09 2024
EVENTS
 FREE
SOFTWARE
INSTITUTE

POLITICS
JOBS
MEMBERS'
CORNER

MAILING
LIST

NYLXS Mailing Lists and Archives
NYLXS Members have a lot to say and share but we don't keep many secrets. Join the Hangout Mailing List and say your peice.

DATE 2016-11-01

LEARN

2024-12-06 | 2024-11-06 | 2024-10-06 | 2024-09-06 | 2024-08-06 | 2024-07-06 | 2024-06-06 | 2024-05-06 | 2024-04-06 | 2024-03-06 | 2024-02-06 | 2024-01-06 | 2023-12-06 | 2023-11-06 | 2023-10-06 | 2023-09-06 | 2023-08-06 | 2023-07-06 | 2023-06-06 | 2023-05-06 | 2023-04-06 | 2023-03-06 | 2023-02-06 | 2023-01-06 | 2022-12-06 | 2022-11-06 | 2022-10-06 | 2022-09-06 | 2022-08-06 | 2022-07-06 | 2022-06-06 | 2022-05-06 | 2022-04-06 | 2022-03-06 | 2022-02-06 | 2022-01-06 | 2021-12-06 | 2021-11-06 | 2021-10-06 | 2021-09-06 | 2021-08-06 | 2021-07-06 | 2021-06-06 | 2021-05-06 | 2021-04-06 | 2021-03-06 | 2021-02-06 | 2021-01-06 | 2020-12-06 | 2020-11-06 | 2020-10-06 | 2020-09-06 | 2020-08-06 | 2020-07-06 | 2020-06-06 | 2020-05-06 | 2020-04-06 | 2020-03-06 | 2020-02-06 | 2020-01-06 | 2019-12-06 | 2019-11-06 | 2019-10-06 | 2019-09-06 | 2019-08-06 | 2019-07-06 | 2019-06-06 | 2019-05-06 | 2019-04-06 | 2019-03-06 | 2019-02-06 | 2019-01-06 | 2018-12-06 | 2018-11-06 | 2018-10-06 | 2018-09-06 | 2018-08-06 | 2018-07-06 | 2018-06-06 | 2018-05-06 | 2018-04-06 | 2018-03-06 | 2018-02-06 | 2018-01-06 | 2017-12-06 | 2017-11-06 | 2017-10-06 | 2017-09-06 | 2017-08-06 | 2017-07-06 | 2017-06-06 | 2017-05-06 | 2017-04-06 | 2017-03-06 | 2017-02-06 | 2017-01-06 | 2016-12-06 | 2016-11-06 | 2016-10-06 | 2016-09-06 | 2016-08-06 | 2016-07-06 | 2016-06-06 | 2016-05-06 | 2016-04-06 | 2016-03-06 | 2016-02-06 | 2016-01-06 | 2015-12-06 | 2015-11-06 | 2015-10-06 | 2015-09-06 | 2015-08-06 | 2015-07-06 | 2015-06-06 | 2015-05-06 | 2015-04-06 | 2015-03-06 | 2015-02-06 | 2015-01-06 | 2014-12-06 | 2014-11-06 | 2014-10-06

Key: Value:

Key: Value:

MESSAGE
DATE 2016-11-05
FROM ruben safir
SUBJECT Subject: [Learn] Fwd: Re: const T vs T const
From learn-bounces-at-nylxs.com Sat Nov 5 02:24:52 2016
Return-Path:
X-Original-To: archive-at-mrbrklyn.com
Delivered-To: archive-at-mrbrklyn.com
Received: from www.mrbrklyn.com (www.mrbrklyn.com [96.57.23.82])
by mrbrklyn.com (Postfix) with ESMTP id 5249E161312;
Sat, 5 Nov 2016 02:24:52 -0400 (EDT)
X-Original-To: learn-at-nylxs.com
Delivered-To: learn-at-nylxs.com
Received: from [10.0.0.62] (flatbush.mrbrklyn.com [10.0.0.62])
by mrbrklyn.com (Postfix) with ESMTP id E6236160E77
for ; Sat, 5 Nov 2016 02:24:49 -0400 (EDT)
References:



<57e973f7$0$3995$e4fe514c-at-newszilla.xs4all.nl>


<87y42dubze.fsf-at-gmail.com>
To: learn-at-nylxs.com
From: ruben safir
X-Forwarded-Message-Id:



<57e973f7$0$3995$e4fe514c-at-newszilla.xs4all.nl>


<87y42dubze.fsf-at-gmail.com>
Message-ID: <9721941c-4729-59e8-62ed-5256dc51e769-at-mrbrklyn.com>
Date: Sat, 5 Nov 2016 02:24:49 -0400
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101
Thunderbird/45.4.0
MIME-Version: 1.0
In-Reply-To: <87y42dubze.fsf-at-gmail.com>
Content-Type: multipart/mixed; boundary="------------5B238A237CD3043287B9DB96"
Subject: [Learn] Fwd: Re: const T vs T const
X-BeenThere: learn-at-nylxs.com
X-Mailman-Version: 2.1.17
Precedence: list
List-Id:
List-Unsubscribe: ,

List-Archive:
List-Post:
List-Help:
List-Subscribe: ,

Errors-To: learn-bounces-at-nylxs.com
Sender: "Learn"

This is a multi-part message in MIME format.
--------------5B238A237CD3043287B9DB96
Content-Type: text/plain; charset=windows-1252
Content-Transfer-Encoding: 7bit

It was possibly in this newsgroup where the topic
"const T vs T const" was discussed some months ago.
(Or it might have been "comp.lang.c".)

Dan Sacks famously wrote about it and recommended
"T const" IIRC.

I now found something new about this topic in the
"Library Design Guidlines" for C++: quote

const goes in the wrong place, i.e., to the left

unquote. Thus, they acknowledge what Dan Sacks
wrote by using "wrong", only to then recommend
the opposite, i.e., "left".

Why? Maybe because tradition dictates this. (No
rationale is given there.)

--------------5B238A237CD3043287B9DB96
Content-Type: message/rfc822;
name="Re: const T vs T const.eml"
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment;
filename="Re: const T vs T const.eml"

Path: reader2.panix.com!panix!goblin1!goblin.stu.neva.ru!border1.nntp.ams1.giganews.com!nntp.giganews.com!buffer1.nntp.ams1.giganews.com!buffer2.nntp.ams1.giganews.com!news.giganews.com.POSTED!not-for-mail
NNTP-Posting-Date: Mon, 26 Sep 2016 13:56:17 -0500
Date: Mon, 26 Sep 2016 21:56:18 +0300
From: Paavo Helde
User-Agent: Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:25.8) Gecko/20151117 FossaMail/25.1.9
MIME-Version: 1.0
Newsgroups: comp.lang.c++
Subject: Re: const T vs T const
References:
In-Reply-To:
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
Message-ID:
X-Usenet-Provider: http://www.giganews.com
X-Trace: sv3-7cNirV39X/3YWxba+Q8YZ/zmJWvF7EBE0wA4mpnfj2ovj+8BhqyhQvlkjuSl1aZJFXHrqraSx0PqMIk!i8gCUth8cSaqoez2JkyCZje8VZmdGmHY2FlXk5xi07qf5gP/LGAbTkNCEB651+QmILoZ95EzBcA=
X-Complaints-To: abuse-at-giganews.com
X-DMCA-Notifications: http://www.giganews.com/info/dmca.html
X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers
X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your complaint properly
X-Postfilter: 1.3.40
X-Original-Bytes: 2084
Xref: panix comp.lang.c++:1123873

On 26.09.2016 20:50, Stefan Ram wrote:
> It was possibly in this newsgroup where the topic
> "const T vs T const" was discussed some months ago.
> (Or it might have been "comp.lang.c".)
>
> Dan Sacks famously wrote about it and recommended
> "T const" IIRC.
>
> I now found something new about this topic in the
> "Library Design Guidlines" for C++: quote
>
> const goes in the wrong place, i.e., to the left
>
> unquote. Thus, they acknowledge what Dan Sacks
> wrote by using "wrong", only to then recommend
> the opposite, i.e., "left".
>
> Why? Maybe because tradition dictates this. (No
> rationale is given there.)


Yes, "T const" would be more regular. However, lots of people prefer
"const T". I guess this is just because when you talk about weather in
English then "constant rain" often makes more sense than "rain constant".

Cheers
Paavo


--------------5B238A237CD3043287B9DB96
Content-Type: message/rfc822;
name="Re: const T vs T const.eml"
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment;
filename="Re: const T vs T const.eml"

Path: reader2.panix.com!panix!bloom-beacon.mit.edu!bloom-beacon.mit.edu!newsswitch.lcs.mit.edu!xmission!nnrp.xmission!.POSTED!not-for-mail
From: legalize+jeeves-at-mail.xmission.com (Richard)
Newsgroups: comp.lang.c++
Subject: Re: const T vs T const
Date: Mon, 26 Sep 2016 19:04:08 +0000 (UTC)
Organization: multi-cellular, biological
Sender: legalize+jeeves-at-mail.xmission.com
Message-ID:
References:
Reply-To: (Richard) legalize+jeeves-at-mail.xmission.com
NNTP-Posting-Host: shell.xmission.com
X-Trace: news.xmission.com 1474916648 22664 2607:fa18:0:beef::4 (26 Sep 2016 19:04:08 GMT)
X-Complaints-To: abuse-at-xmission.com
NNTP-Posting-Date: Mon, 26 Sep 2016 19:04:08 +0000 (UTC)
X-Reply-Etiquette: No copy by email, please
Mail-Copies-To: never
X-Newsreader: trn 4.0-test77 (Sep 1, 2010)
Originator: legalize-at-shell.xmission.com (Richard)
Xref: panix comp.lang.c++:1123874

[Please do not mail me a copy of your followup]

Paavo Helde spake the secret code
thusly:

>Yes, "T const" would be more regular. However, lots of people prefer
>"const T".

In interviews I ask people to write the declaration for a constant
pointer to constant character. When they've only ever seen const on
the left, they freeze up.
--
"The Direct3D Graphics Pipeline" free book
The Computer Graphics Museum
The Terminals Wiki
Legalize Adulthood! (my blog)

--------------5B238A237CD3043287B9DB96
Content-Type: message/rfc822;
name="Re: const T vs T const.eml"
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment;
filename="Re: const T vs T const.eml"

Path: reader2.panix.com!panix!goblin1!goblin.stu.neva.ru!border1.nntp.ams1.giganews.com!nntp.giganews.com!buffer1.nntp.ams1.giganews.com!news.giganews.com.POSTED!not-for-mail
NNTP-Posting-Date: Mon, 26 Sep 2016 14:10:48 -0500
Date: Mon, 26 Sep 2016 22:10:49 +0300
From: Paavo Helde
User-Agent: Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:25.8) Gecko/20151117 FossaMail/25.1.9
MIME-Version: 1.0
Newsgroups: comp.lang.c++
Subject: Re: const T vs T const
References:
In-Reply-To:
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
Message-ID:
X-Usenet-Provider: http://www.giganews.com
X-Trace: sv3-C3Fa3OxEHtdTEzhWqkvaatJ5QUTiVtWgH0RUZYR0+2ZZ2EPj2mN/oe5VrcxzDBpHc1Pw6kix6gCeCpJ!EgNIZ++pYa1BeqZMwjD4uGhuSJr35PpqGTVQ1QbbAO0uZDpQJq3DanC01eIhDuosq8kHuDg/z48=
X-Complaints-To: abuse-at-giganews.com
X-DMCA-Notifications: http://www.giganews.com/info/dmca.html
X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers
X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your complaint properly
X-Postfilter: 1.3.40
X-Original-Bytes: 1810
Xref: panix comp.lang.c++:1123875

On 26.09.2016 22:04, Richard wrote:
> [Please do not mail me a copy of your followup]
>
> Paavo Helde spake the secret code
> thusly:
>
>> Yes, "T const" would be more regular. However, lots of people prefer
>> "const T".
>
> In interviews I ask people to write the declaration for a constant
> pointer to constant character. When they've only ever seen const on
> the left, they freeze up.

And if they have only ever seen 'char const *p', do they not freeze up?
Just curious...




--------------5B238A237CD3043287B9DB96
Content-Type: message/rfc822;
name="Re: const T vs T const.eml"
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment;
filename="Re: const T vs T const.eml"

Path: reader2.panix.com!panix!goblin1!goblin.stu.neva.ru!eternal-september.org!feeder.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: "Chris M. Thomasson"
Newsgroups: comp.lang.c++
Subject: Re: const T vs T const
Date: Mon, 26 Sep 2016 12:21:46 -0700
Organization: n/a
Message-ID:
References:



Mime-Version: 1.0
Content-Type: text/plain; charset=windows-1252; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Mon, 26 Sep 2016 19:21:35 -0000 (UTC)
Injection-Info: mx02.eternal-september.org; posting-host="739b93b3e8fb02997bb34eb27d938fcc";
logging-data="6809"; mail-complaints-to="abuse-at-eternal-september.org"; posting-account="U2FsdGVkX19EGno8SOOGJo3e+UXhbKl3s1OMMePWC5Y="
User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:45.0) Gecko/20100101
Thunderbird/45.3.0
In-Reply-To:
Cancel-Lock: sha1:6JL+x5uJPfWwdK1DO8VPR4M6Cg0=
Xref: panix comp.lang.c++:1123877

On 9/26/2016 12:10 PM, Paavo Helde wrote:
> On 26.09.2016 22:04, Richard wrote:
>> [Please do not mail me a copy of your followup]
>>
>> Paavo Helde spake the secret code
>> thusly:
>>
>>> Yes, "T const" would be more regular. However, lots of people prefer
>>> "const T".
>>
>> In interviews I ask people to write the declaration for a constant
>> pointer to constant character. When they've only ever seen const on
>> the left, they freeze up.
>
> And if they have only ever seen 'char const *p', do they not freeze up?
> Just curious...

IMVHO, they really shouldn't. I personally write these things from right
to left, so a constant pointer to a constant character would be:

char const* const

Read right to left, it is const *, to const char.

IMHO, its pretty straightforward.

--------------5B238A237CD3043287B9DB96
Content-Type: message/rfc822;
name="Re: const T vs T const.eml"
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment;
filename="Re: const T vs T const.eml"

Path: reader2.panix.com!panix!bloom-beacon.mit.edu!bloom-beacon.mit.edu!newsswitch.lcs.mit.edu!xmission!nnrp.xmission!.POSTED!not-for-mail
From: legalize+jeeves-at-mail.xmission.com (Richard)
Newsgroups: comp.lang.c++
Subject: Re: const T vs T const
Date: Mon, 26 Sep 2016 23:15:49 +0000 (UTC)
Organization: multi-cellular, biological
Sender: legalize+jeeves-at-mail.xmission.com
Message-ID:
References:
Reply-To: (Richard) legalize+jeeves-at-mail.xmission.com
NNTP-Posting-Host: shell.xmission.com
X-Trace: news.xmission.com 1474931749 31424 2607:fa18:0:beef::4 (26 Sep 2016 23:15:49 GMT)
X-Complaints-To: abuse-at-xmission.com
NNTP-Posting-Date: Mon, 26 Sep 2016 23:15:49 +0000 (UTC)
X-Reply-Etiquette: No copy by email, please
Mail-Copies-To: never
X-Newsreader: trn 4.0-test77 (Sep 1, 2010)
Originator: legalize-at-shell.xmission.com (Richard)
Xref: panix comp.lang.c++:1123881

[Please do not mail me a copy of your followup]

Paavo Helde spake the secret code
thusly:

>On 26.09.2016 22:04, Richard wrote:
>> [Please do not mail me a copy of your followup]
>>
>> Paavo Helde spake the secret code
>> thusly:
>>
>>> Yes, "T const" would be more regular. However, lots of people prefer
>>> "const T".
>>
>> In interviews I ask people to write the declaration for a constant
>> pointer to constant character. When they've only ever seen const on
>> the left, they freeze up.
>
>And if they have only ever seen 'char const *p', do they not freeze up?
>Just curious...

I don't know. Noone I've interviewed has ever been able to answer
the question without help.
--
"The Direct3D Graphics Pipeline" free book
The Computer Graphics Museum
The Terminals Wiki
Legalize Adulthood! (my blog)

--------------5B238A237CD3043287B9DB96
Content-Type: message/rfc822;
name="Re: const T vs T const.eml"
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment;
filename="Re: const T vs T const.eml"

Path: reader2.panix.com!panix!news.linkpendium.com!news.linkpendium.com!news.snarked.org!xmission!nnrp.xmission!.POSTED!not-for-mail
From: legalize+jeeves-at-mail.xmission.com (Richard)
Newsgroups: comp.lang.c++
Subject: Re: const T vs T const
Date: Mon, 26 Sep 2016 23:16:32 +0000 (UTC)
Organization: multi-cellular, biological
Sender: legalize+jeeves-at-mail.xmission.com
Message-ID:
References:
Reply-To: (Richard) legalize+jeeves-at-mail.xmission.com
NNTP-Posting-Host: shell.xmission.com
X-Trace: news.xmission.com 1474931792 31464 2607:fa18:0:beef::4 (26 Sep 2016 23:16:32 GMT)
X-Complaints-To: abuse-at-xmission.com
NNTP-Posting-Date: Mon, 26 Sep 2016 23:16:32 +0000 (UTC)
X-Reply-Etiquette: No copy by email, please
Mail-Copies-To: never
X-Newsreader: trn 4.0-test77 (Sep 1, 2010)
Originator: legalize-at-shell.xmission.com (Richard)
Xref: panix comp.lang.c++:1123882

[Please do not mail me a copy of your followup]

(Richard) legalize+jeeves-at-mail.xmission.com spake the secret code
thusly:

>[Please do not mail me a copy of your followup]
>
>Paavo Helde spake the secret code
> thusly:
>
>>On 26.09.2016 22:04, Richard wrote:
>>> [Please do not mail me a copy of your followup]
>>>
>>> Paavo Helde spake the secret code
>>> thusly:
>>>
>>>> Yes, "T const" would be more regular. However, lots of people prefer
>>>> "const T".
>>>
>>> In interviews I ask people to write the declaration for a constant
>>> pointer to constant character. When they've only ever seen const on
>>> the left, they freeze up.
>>
>>And if they have only ever seen 'char const *p', do they not freeze up?
>>Just curious...
>
>I don't know. Noone I've interviewed has ever been able to answer
>the question without help.

...and all their attempts had const on the left until they tried to
figure out how to express the idea that the pointer was const and
then they failed.
--
"The Direct3D Graphics Pipeline" free book
The Computer Graphics Museum
The Terminals Wiki
Legalize Adulthood! (my blog)

--------------5B238A237CD3043287B9DB96
Content-Type: message/rfc822;
name="Re: const T vs T const.eml"
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment;
filename="Re: const T vs T const.eml"

Path: reader2.panix.com!panix!goblin2!goblin1!goblin.stu.neva.ru!uio.no!news.tele.dk!news.tele.dk!small.news.tele.dk!newsgate.cistron.nl!newsgate.news.xs4all.nl!nzpost2.xs4all.net!not-for-mail
Subject: Re: const T vs T const
Newsgroups: comp.lang.c++
References:


From: Wouter van Ooijen
Date: Mon, 26 Sep 2016 21:16:12 +0200
User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:45.0) Gecko/20100101
Thunderbird/45.3.0
MIME-Version: 1.0
In-Reply-To:
Content-Type: text/plain; charset=windows-1252; format=flowed
Content-Transfer-Encoding: 7bit
Message-ID: <57e973f7$0$3995$e4fe514c-at-newszilla.xs4all.nl>
NNTP-Posting-Host: 2001:980:a9b1:1:8c7:2877:c06d:a6ef
X-Trace: 1474917367 dreader35.news.xs4all.nl 3995 [2001:980:a9b1:1:8c7:2877:c06d:a6ef]:55485
X-Complaints-To: abuse-at-xs4all.nl
Xref: panix comp.lang.c++:1123876

Op 26-Sep-16 om 9:04 PM schreef Richard:
> [Please do not mail me a copy of your followup]
>
> Paavo Helde spake the secret code
> thusly:
>
>> Yes, "T const" would be more regular. However, lots of people prefer
>> "const T".
>
> In interviews I ask people to write the declaration for a constant
> pointer to constant character. When they've only ever seen const on
> the left, they freeze up.

I would refuse to write that as one declaration.

Wouter "Objects? No Thanks!" van Ooijen


--------------5B238A237CD3043287B9DB96
Content-Type: message/rfc822;
name="Re: const T vs T const.eml"
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment;
filename="Re: const T vs T const.eml"

Path: reader2.panix.com!panix!usenet.stanford.edu!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail
From: Bo Persson
Newsgroups: comp.lang.c++
Subject: Re: const T vs T const
Date: Mon, 26 Sep 2016 22:16:02 +0200
Message-ID:
References:
Mime-Version: 1.0
Content-Type: text/plain; charset=windows-1252; format=flowed
Content-Transfer-Encoding: 7bit
X-Trace: individual.net 7pzhzj9PjUHQahEkm4VrZAmXDMxg8PsvropWmFHeeemULcTbh+
Cancel-Lock: sha1:8Tq4oMJ44dpphM7h7JEXqu8zgmE=
User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:45.0) Gecko/20100101
Thunderbird/45.3.0
In-Reply-To:
Xref: panix comp.lang.c++:1123878

On 2016-09-26 19:50, Stefan Ram wrote:
> It was possibly in this newsgroup where the topic
> "const T vs T const" was discussed some months ago.
> (Or it might have been "comp.lang.c".)
>
> Dan Sacks famously wrote about it and recommended
> "T const" IIRC.
>
> I now found something new about this topic in the
> "Library Design Guidlines" for C++: quote
>
> const goes in the wrong place, i.e., to the left
>
> unquote. Thus, they acknowledge what Dan Sacks
> wrote by using "wrong", only to then recommend
> the opposite, i.e., "left".
>
> Why? Maybe because tradition dictates this. (No
> rationale is given there.)
>

Of course there is no rationale, so we have to pick one order.
Apparently Bjarne has always preferred "const int i = 0;".


And I have never seen anyone arguing that

constexpr int x = 0;

is the wrong order. So why have different rules for const and constexpr?


Bo Persson






--------------5B238A237CD3043287B9DB96
Content-Type: message/rfc822;
name="Re: const T vs T const.eml"
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment;
filename="Re: const T vs T const.eml"

Path: reader2.panix.com!panix!goblin3!goblin.stu.neva.ru!nntp-feed.chiark.greenend.org.uk!ewrotcd!eternal-september.org!feeder.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: "Alf P. Steinbach"
Newsgroups: comp.lang.c++
Subject: Re: const T vs T const
Date: Tue, 27 Sep 2016 00:41:46 +0200
Organization: A noiseless patient Spider
Message-ID:
References:
Mime-Version: 1.0
Content-Type: text/plain; charset=windows-1252; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Mon, 26 Sep 2016 22:42:51 -0000 (UTC)
Injection-Info: mx02.eternal-september.org; posting-host="737328bde590e659c1fc5acc416a6973";
logging-data="19154"; mail-complaints-to="abuse-at-eternal-september.org"; posting-account="U2FsdGVkX19T7gK3Cci76iQQf/jvHn67"
User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:45.0) Gecko/20100101
Thunderbird/45.3.0
In-Reply-To:
Cancel-Lock: sha1:Jdrw/I8Scg8MaytO1nqFGfXAao8=
Xref: panix comp.lang.c++:1123880

On 26.09.2016 19:50, Stefan Ram wrote:
> It was possibly in this newsgroup where the topic
> "const T vs T const" was discussed some months ago.
> (Or it might have been "comp.lang.c".)
>
> Dan Sacks famously wrote about it and recommended
> "T const" IIRC.

In order to write `const` first, simply define

template< class Type >
using Ptr_ = Type*;

Now write e.g.

Ptr_ p;

and

const Ptr_ p;

Easy peasy. :)

Well except for `auto` type deduction, there's a kind of black hole in
the language there, but one can live with that.



> I now found something new about this topic in the
> "Library Design Guidlines" for C++: quote
>
> const goes in the wrong place, i.e., to the left
>
> unquote. Thus, they acknowledge what Dan Sacks
> wrote by using "wrong", only to then recommend
> the opposite, i.e., "left".
>
> Why? Maybe because tradition dictates this. (No
> rationale is given there.)

Not sure exactly what you're quoting here or what you're asking for
rationale about, can you clarify?


Cheers!,

- Alf


--------------5B238A237CD3043287B9DB96
Content-Type: message/rfc822;
name="Re: const T vs T const.eml"
Content-Transfer-Encoding: base64
Content-Disposition: attachment;
filename="Re: const T vs T const.eml"



--------------5B238A237CD3043287B9DB96
Content-Type: message/rfc822;
name="Re: const T vs T const.eml"
Content-Transfer-Encoding: 8bit
Content-Disposition: attachment;
filename="Re: const T vs T const.eml"

Path: reader2.panix.com!panix!bloom-beacon.mit.edu!bloom-beacon.mit.edu!168.235.88.217.MISMATCH!2.us.feeder.erje.net!feeder.erje.net!1.eu.feeder.erje.net!feeder3.usenet.farm!feeder2.usenet.farm!eternal-september.org!feeder.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: "Alf P. Steinbach"
Newsgroups: comp.lang.c++
Subject: Re: const T vs T const
Date: Tue, 27 Sep 2016 05:31:14 +0200
Organization: A noiseless patient Spider
Message-ID:
References:


Mime-Version: 1.0
Content-Type: text/plain; charset=windows-1252; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Date: Tue, 27 Sep 2016 03:32:20 -0000 (UTC)
Injection-Info: mx02.eternal-september.org; posting-host="737328bde590e659c1fc5acc416a6973";
logging-data="20782"; mail-complaints-to="abuse-at-eternal-september.org"; posting-account="U2FsdGVkX1/Qr+a8kvqPr53lmmOjw/lW"
User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:45.0) Gecko/20100101
Thunderbird/45.3.0
In-Reply-To:
Cancel-Lock: sha1:/Q+01ExQ8qa4kgZqoEVQo7OZohM=
Xref: panix comp.lang.c++:1123889

On 27.09.2016 01:34, Stefan Ram wrote:
> "Alf P. Steinbach" writes:
>> Not sure exactly what you're quoting here or what you're asking for
>> rationale about, can you clarify?
>
> The rationale for the apparent guideline to write
>
> const int i = 2;
>
> instead of
>
> int const i = 2;
>
> . I was quoting the Library Design Guidelines
> (Standard Library Guidelines) from isocpp.org.
>

Oh, I understand. Sorry.

Well, standard library work has to follow the conventions already
established for the C++ standard. It would be just too much work to
change those conventions now. So that's a very direct rationale.

I read ?the wrong place? as an acknowledgment that the original choice,
back in the 1990's, was sub-optimal.

But, in modern C++ we don't have to cater to the idiosyncracies of the C
declaration syntax.

We can just define a `Ptr_` type builder, and a `Ref_`, and so on.

? ? ?

At first, years ago, I went all the way and also defined `Const_`.

But it's silly to define a new syntax where the current one works.

I found it useful to define a `With_const_like_`, in order to transfer
constness from one type to another. But I'm still searching for a
better, shorter name for that.

? ? ?

There is also a more radical idea of defining `const` versions of all
the basic types and require use of e.g. `Var_` to make something
mutable. I don't think this idea can be made practically workable: the
confusion would be akin to redefining `+` as `-`. But with this idea

Ptr_ p;

would not compile, because it would declare an uninitialized `int const*
const`.

One would have write e.g.

Var_> p;

to get something mutable.

Or

Ptr_> p = &blah;

:)


Cheers!,

- Alf


--------------5B238A237CD3043287B9DB96
Content-Type: message/rfc822;
name="Re: const T vs T const.eml"
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment;
filename="Re: const T vs T const.eml"

Path: reader2.panix.com!panix!goblin3!goblin.stu.neva.ru!news.roellig-ltd.de!open-news-network.org!border2.nntp.ams1.giganews.com!nntp.giganews.com!buffer2.nntp.ams1.giganews.com!nntp.brightview.co.uk!news.brightview.co.uk.POSTED!not-for-mail
NNTP-Posting-Date: Tue, 27 Sep 2016 00:51:17 -0500
From: Gareth Owen
Newsgroups: comp.lang.c++
Subject: Re: const T vs T const
References:
Date: Tue, 27 Sep 2016 06:51:17 +0100
Message-ID: <87y42dubze.fsf-at-gmail.com>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.5 (gnu/linux)
Cancel-Lock: sha1:VKnvxh72m/SEKIcp6HBG1MvWAdA=
MIME-Version: 1.0
Content-Type: text/plain
X-Usenet-Provider: http://www.giganews.com
X-Trace: sv3-KcLbfKUFb8shpC/rbVMNOYu3mu8X8d3Skt+kWADyC1YBZAIM7d38QNXYVL0aosbI3DmJQubszqw5yFS!Kwul1YRFGLrrLgQkFxGXnAEmyQIortEYyhwYmnFcVCusX61u+yNVLZ8EeEAiWN18gvzjZA==
X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers
X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your complaint properly
X-Postfilter: 1.3.40
X-Original-Bytes: 1231
Xref: panix comp.lang.c++:1123890

ram-at-zedat.fu-berlin.de (Stefan Ram) writes:

> It was possibly in this newsgroup where the topic
> "const T vs T const" was discussed some months ago.
> (Or it might have been "comp.lang.c".)

As an equally vital followup, how many angels can we fit on the head of
a pin?

--------------5B238A237CD3043287B9DB96
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

_______________________________________________
Learn mailing list
Learn-at-nylxs.com
http://lists.mrbrklyn.com/mailman/listinfo/learn

--------------5B238A237CD3043287B9DB96--

  1. 2016-11-01 Ruben Safir <ruben-at-mrbrklyn.com> Re: [Learn] how is it indexing in cuda
  2. 2016-11-01 Ruben Safir <ruben.safir-at-my.liu.edu> Re: [Learn] not adequately speced of explained
  3. 2016-11-01 Ruben Safir <ruben-at-mrbrklyn.com> Subject: [Learn] how is it indexing in cuda
  4. 2016-11-01 Ruben Safir <ruben-at-mrbrklyn.com> Subject: [Learn] not adequately speced of explained
  5. 2016-11-02 Christopher League <league-at-contrapunctus.net> Re: [Learn] Fitch Algorithm - C++
  6. 2016-11-02 Ruben Safir <mrbrklyn-at-panix.com> Re: [Learn] Fitch Algorithm - C++
  7. 2016-11-02 Ruben Safir <ruben-at-mrbrklyn.com> Re: [Learn] how is it indexing in cuda
  8. 2016-11-02 Ruben Safir <ruben-at-mrbrklyn.com> Subject: [Learn] Fitch Algorithm - C++
  9. 2016-11-02 IEEE Computer Society <csconnection-at-computer.org> Subject: [Learn] Hear Google's John Martinis Take on Quantum Computing at
  10. 2016-11-02 Ruben Safir <ruben-at-mrbrklyn.com> Subject: [Learn] opencl
  11. 2016-11-02 Ruben Safir <ruben-at-mrbrklyn.com> Subject: [Learn] scheduled for tommorw
  12. 2016-11-02 Ruben Safir <ruben-at-mrbrklyn.com> Subject: [Learn] threads tutorial
  13. 2016-11-03 Ruben Safir <mrbrklyn-at-panix.com> Re: [Learn] Fitch Algorithm - C++
  14. 2016-11-03 Ruben Safir <mrbrklyn-at-panix.com> Re: [Learn] Fitch Algorithm - C++
  15. 2016-11-03 Ruben Safir <mrbrklyn-at-panix.com> Re: [Learn] Fitch Algorithm - C++
  16. 2016-11-03 Christopher League <league-at-contrapunctus.net> Re: [Learn] huffman code
  17. 2016-11-03 Ruben Safir <ruben-at-mrbrklyn.com> Re: [Learn] huffman code
  18. 2016-11-03 Ruben Safir <ruben.safir-at-my.liu.edu> Re: [Learn] huffman code
  19. 2016-11-03 Ruben Safir <ruben-at-mrbrklyn.com> Subject: [Learn] Fitch algorithm from the beginning
  20. 2016-11-03 From: <mrbrklyn-at-panix.com> Subject: [Learn] huffman code
  21. 2016-11-03 Ruben Safir <ruben-at-mrbrklyn.com> Subject: [Learn] Phenology meeting
  22. 2016-11-03 Ruben Safir <ruben-at-mrbrklyn.com> Subject: [Learn] relevant hackathon
  23. 2016-11-03 Ruben Safir <ruben-at-mrbrklyn.com> Subject: [Learn] relevant hackathon
  24. 2016-11-04 Ruben Safir <mrbrklyn-at-panix.com> Re: [Learn] huffman code
  25. 2016-11-04 Christopher League <league-at-contrapunctus.net> Subject: [Learn] Fitch/Sankoff
  26. 2016-11-05 Christopher League <league-at-contrapunctus.net> Re: [Learn] Fwd: templates within templates
  27. 2016-11-05 ruben safir <ruben-at-mrbrklyn.com> Subject: [Learn] Fwd: Re: const T vs T const
  28. 2016-11-05 ruben safir <ruben-at-mrbrklyn.com> Subject: [Learn] Fwd: Template Library files and Header linking troubles
  29. 2016-11-05 ruben safir <ruben-at-mrbrklyn.com> Subject: [Learn] Fwd: templates within templates
  30. 2016-11-06 Ruben Safir <mrbrklyn-at-panix.com> Re: [Learn] Fwd: templates within templates
  31. 2016-11-06 Ruben Safir <ruben-at-mrbrklyn.com> Re: [Learn] Fwd: templates within templates
  32. 2016-11-06 Ruben Safir <mrbrklyn-at-panix.com> Re: [Learn] Fwd: templates within templates
  33. 2016-11-06 Christopher League <league-at-contrapunctus.net> Re: [Learn] Fwd: templates within templates
  34. 2016-11-06 Ruben Safir <mrbrklyn-at-panix.com> Re: [Learn] Fwd: templates within templates
  35. 2016-11-06 Ruben Safir <ruben-at-mrbrklyn.com> Re: [Learn] Fwd: templates within templates
  36. 2016-11-06 Ruben Safir <ruben-at-mrbrklyn.com> Re: [Learn] Fwd: templates within templates
  37. 2016-11-06 Ruben Safir <ruben-at-mrbrklyn.com> Re: [Learn] GNU Parallel 20161022 ('Matthew') released [stable]
  38. 2016-11-07 Ruben Safir <ruben-at-mrbrklyn.com> Subject: [Learn] templates and ostream for future reference
  39. 2016-11-08 Christopher League <league-at-contrapunctus.net> Re: [Learn] C++ signature ambiguity
  40. 2016-11-08 Ruben Safir <ruben.safir-at-my.liu.edu> Re: [Learn] C++ signature ambiguity
  41. 2016-11-08 Ruben Safir <ruben-at-mrbrklyn.com> Subject: [Learn] C++ signature ambiguity
  42. 2016-11-08 Ruben Safir <ruben-at-mrbrklyn.com> Subject: [Learn] Fwd: Invitation: Phylogeny meeting -at- Weekly from 10:15 to
  43. 2016-11-08 Ruben Safir <mrbrklyn-at-panix.com> Subject: [Learn] Fwd: [nylug-talk] RSVP open: Wed Nov 16,
  44. 2016-11-09 Christopher League <league-at-contrapunctus.net> Re: [Learn] merge sort parallel hw
  45. 2016-11-09 Ruben Safir <ruben-at-mrbrklyn.com> Re: [Learn] merge sort parallel hw
  46. 2016-11-09 Ruben Safir <ruben-at-mrbrklyn.com> Re: [Learn] merge sort parallel hw
  47. 2016-11-09 Christopher League <league-at-contrapunctus.net> Re: [Learn] merge sort parallel hw
  48. 2016-11-09 Ruben Safir <ruben-at-mrbrklyn.com> Re: [Learn] mergesort tutorial
  49. 2016-11-09 Christopher League <league-at-contrapunctus.net> Re: [Learn] mergesort tutorial
  50. 2016-11-09 Christopher League <league-at-contrapunctus.net> Re: [Learn] namespace and external files confusion
  51. 2016-11-09 Ruben Safir <ruben-at-mrbrklyn.com> Re: [Learn] namespace and external files confusion
  52. 2016-11-09 From: "Carlos R. Mafra" <crmafra-at-gmail.com> Re: [Learn] Question about a small change
  53. 2016-11-09 Ruben Safir <ruben-at-mrbrklyn.com> Subject: [Learn] =?utf-8?q?C++_call_of_overloaded_=E2=80=98track=28int*=26?=
  54. 2016-11-09 ruben safir <ruben-at-mrbrklyn.com> Subject: [Learn] Fwd: lost arguments
  55. 2016-11-09 Ruben Safir <ruben-at-mrbrklyn.com> Subject: [Learn] Fwd: [dinosaur] Dating origins of dinosaurs,
  56. 2016-11-09 Ruben Safir <ruben-at-mrbrklyn.com> Subject: [Learn] merge sort parallel hw
  57. 2016-11-09 Ruben Safir <ruben-at-mrbrklyn.com> Subject: [Learn] mergesort tutorial
  58. 2016-11-09 Ruben Safir <ruben-at-mrbrklyn.com> Subject: [Learn] namespace and external files confusion
  59. 2016-11-10 Christopher League <league-at-contrapunctus.net> Re: [Learn] merge sort parallel hw
  60. 2016-11-10 Ruben Safir <mrbrklyn-at-panix.com> Re: [Learn] merge sort parallel hw
  61. 2016-11-10 Ruben Safir <mrbrklyn-at-panix.com> Re: [Learn] merge sort parallel hw
  62. 2016-11-10 Ruben Safir <ruben.safir-at-my.liu.edu> Re: [Learn] merge sort parallel hw
  63. 2016-11-10 Ruben Safir <ruben-at-mrbrklyn.com> Re: [Learn] [Hangout-NYLXS] mergesort tutorial
  64. 2016-11-10 Ruben Safir <mrbrklyn-at-panix.com> Subject: [Learn] Fwd: [Hangout-NYLXS] ease your mind- everything in the
  65. 2016-11-10 Ruben Safir <ruben.safir-at-my.liu.edu> Subject: [Learn] Fwd: [Hangout-NYLXS] R Programming Workshop
  66. 2016-11-10 Ruben Safir <ruben-at-mrbrklyn.com> Subject: [Learn] Paleocast phenogenetic tree building
  67. 2016-11-11 Christopher League <league-at-contrapunctus.net> Re: [Learn] merge sort parallel hw
  68. 2016-11-12 Ruben Safir <ruben-at-mrbrklyn.com> Subject: [Learn] HW of mergesort in parallel
  69. 2016-11-13 Ruben Safir <ruben-at-mrbrklyn.com> Subject: [Learn] merge sort in parallel assignment
  70. 2016-11-14 Christopher League <league-at-contrapunctus.net> Re: [Learn] merge sort in parallel assignment
  71. 2016-11-14 Ruben Safir <ruben-at-mrbrklyn.com> Re: [Learn] merge sort in parallel assignment
  72. 2016-11-14 Ruben Safir <ruben-at-mrbrklyn.com> Re: [Learn] merge sort parallel hw
  73. 2016-11-14 Ruben Safir <ruben-at-mrbrklyn.com> Subject: [Learn] CUDA and video
  74. 2016-11-14 Ruben Safir <ruben-at-mrbrklyn.com> Subject: [Learn] PNG Graphic formats and CRCs
  75. 2016-11-15 ruben safir <ruben-at-mrbrklyn.com> Subject: [Learn] Fwd: PNG coding
  76. 2016-11-15 ruben safir <ruben.safir-at-my.liu.edu> Subject: [Learn] Fwd: PNG Coding
  77. 2016-11-16 Ruben Safir <ruben-at-mrbrklyn.com> Re: [Learn] Fwd: lost arguments
  78. 2016-11-16 Ruben Safir <ruben-at-mrbrklyn.com> Re: [Learn] relevant hackathon
  79. 2016-11-16 Ruben Safir <ruben-at-mrbrklyn.com> Subject: [Learn] C++ Workshop Announcement
  80. 2016-11-16 Ruben Safir <mrbrklyn-at-panix.com> Subject: [Learn] Fwd: Re: ref use
  81. 2016-11-16 Ruben Safir <ruben-at-mrbrklyn.com> Subject: [Learn] ref use
  82. 2016-11-16 Ruben Safir <ruben-at-mrbrklyn.com> Subject: [Learn] why use a reference wrapper int his example
  83. 2016-11-17 Ruben Safir <mrbrklyn-at-panix.com> Re: [Learn] [Hangout-NYLXS] at K&R now
  84. 2016-11-17 Ruben Safir <ruben-at-mrbrklyn.com> Subject: [Learn] Fwd: [Hangout-NYLXS] Fwd: PNG Coding
  85. 2016-11-18 ruben safir <ruben-at-mrbrklyn.com> Subject: [Learn] C++ workshop and usenet responses
  86. 2016-11-19 ruben safir <ruben-at-mrbrklyn.com> Subject: [Learn] Fwd: ref use
  87. 2016-11-20 Ruben Safir <ruben-at-mrbrklyn.com> Subject: [Learn] when is the constructor called for an object
  88. 2016-11-21 ruben safir <ruben-at-mrbrklyn.com> Subject: [Learn] Fwd: creating a binary tree
  89. 2016-11-21 ruben safir <ruben-at-mrbrklyn.com> Subject: [Learn] Fwd: hidden static
  90. 2016-11-21 Ruben Safir <ruben-at-mrbrklyn.com> Subject: [Learn] Fwd: ISBI 2017 Call for Abstracts and Non-Author
  91. 2016-11-21 ruben safir <ruben-at-mrbrklyn.com> Subject: [Learn] Fwd: PNG coding
  92. 2016-11-21 ruben safir <ruben-at-mrbrklyn.com> Subject: [Learn] Fwd: Re: the new {} syntax
  93. 2016-11-21 ruben safir <ruben-at-mrbrklyn.com> Subject: [Learn] Fwd: when is the constructor called for an object
  94. 2016-11-21 ruben safir <ruben-at-mrbrklyn.com> Subject: [Learn] Fwd: when is the constructor called for an object
  95. 2016-11-21 Ruben Safir <ruben-at-mrbrklyn.com> Subject: [Learn] Fwd: [dinosaur] Eoconfuciusornis feather keratin and
  96. 2016-11-21 Ruben Safir <ruben-at-mrbrklyn.com> Subject: [Learn] look what I found
  97. 2016-11-22 Ruben Safir <ruben-at-mrbrklyn.com> Subject: [Learn] Cuccuency book
  98. 2016-11-22 ruben safir <ruben.safir-at-my.liu.edu> Subject: [Learn] declare a func or call an object
  99. 2016-11-22 Ruben Safir <ruben.safir-at-my.liu.edu> Subject: [Learn] Fwd: Re: Using CLIPS as a library
  100. 2016-11-23 Ruben Safir <ruben.safir-at-my.liu.edu> Subject: [Learn] Fwd: Simple C++11 Wrapper for CLIPS 6.30
  101. 2016-11-23 Ruben Safir <ruben-at-mrbrklyn.com> Subject: [Learn] Parrelel Programming HW2 with maxpath
  102. 2016-11-24 Ruben Safir <ruben-at-mrbrklyn.com> Subject: [Learn] great research news for big data
  103. 2016-11-24 Ruben Safir <ruben-at-mrbrklyn.com> Subject: [Learn] mapping algorithms
  104. 2016-11-24 Ruben Safir <ruben-at-mrbrklyn.com> Subject: [Learn] Todays meeting
  105. 2016-11-25 Ruben Safir <ruben-at-mrbrklyn.com> Subject: [Learn] Fwd: [dinosaur] Flightless theropod phylogenetic variation
  106. 2016-11-26 Ruben Safir <ruben-at-mrbrklyn.com> Re: [Learn] Note to self for Thursday
  107. 2016-11-26 Ruben Safir <ruben-at-mrbrklyn.com> Subject: [Learn] Fitch etc
  108. 2016-11-26 Ruben Safir <ruben-at-mrbrklyn.com> Subject: [Learn] Note to self for Thursday
  109. 2016-11-26 Ruben Safir <ruben-at-mrbrklyn.com> Subject: [Learn] operator<<() overloading details and friend
  110. 2016-11-27 Ruben Safir <ruben-at-mrbrklyn.com> Subject: [Learn] 130 year old feathers analysis
  111. 2016-11-27 ruben safir <ruben-at-mrbrklyn.com> Subject: [Learn] Fwd: ACM/SPEC ICPE 2017 - Call for Tutorial Proposals
  112. 2016-11-27 ruben safir <ruben-at-mrbrklyn.com> Subject: [Learn] Fwd: ACM/SPEC ICPE 2017 - Call for Workshop Proposals
  113. 2016-11-27 ruben safir <ruben-at-mrbrklyn.com> Subject: [Learn] Fwd: CfP 22nd Conf. Reliable Software Technologies,
  114. 2016-11-27 ruben safir <ruben-at-mrbrklyn.com> Subject: [Learn] Fwd: Seeking contributors for psyche-c
  115. 2016-11-29 Christopher League <league-at-contrapunctus.net> Re: [Learn] Look at this exciting output by my test program
  116. 2016-11-29 Ruben Safir <ruben-at-mrbrklyn.com> Re: [Learn] Look at this exciting output by my test program
  117. 2016-11-29 Ruben Safir <ruben-at-mrbrklyn.com> Re: [Learn] Look at this exciting output by my test program
  118. 2016-11-29 Christopher League <league-at-contrapunctus.net> Re: [Learn] Quantum Entanglement
  119. 2016-11-29 Ruben Safir <mrbrklyn-at-panix.com> Re: [Learn] Quantum Entanglement
  120. 2016-11-29 Ruben Safir <ruben-at-mrbrklyn.com> Subject: [Learn] Here is the paper I was talking out
  121. 2016-11-29 Ruben Safir <ruben-at-mrbrklyn.com> Subject: [Learn] Look at this exciting output by my test program
  122. 2016-11-29 nylxs <mrbrklyn-at-optonline.net> Subject: [Learn] Look at this exciting output by my test program
  123. 2016-11-29 Ruben Safir <ruben-at-mrbrklyn.com> Subject: [Learn] Quantum Entanglement
  124. 2016-11-29 Ruben Safir <ruben-at-mrbrklyn.com> Subject: [Learn] The Death of PBS
  125. 2016-11-29 Ruben Safir <ruben-at-mrbrklyn.com> Subject: [Learn] witmer lab ohio and 3d imaging
  126. 2016-11-30 Ruben Safir <ruben-at-mrbrklyn.com> Subject: [Learn] phylogenetic crawler

NYLXS are Do'ers and the first step of Doing is Joining! Join NYLXS and make a difference in your community today!