Deutsch   English   Français   Italiano  
<voq1f5$v3u$5@dont-email.me>

View for Bookmarking (what is this?)
Look up another Usenet article

Path: ...!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!eternal-september.org!.POSTED!not-for-mail
From: Chris Ahlstrom <OFeem1987@teleworm.us>
Newsgroups: comp.os.linux.misc,comp.os.linux.advocacy
Subject: Re: GIMP 3.0.0-RC1
Date: Sat, 15 Feb 2025 07:31:32 -0500
Organization: None
Lines: 26
Message-ID: <voq1f5$v3u$5@dont-email.me>
References: <vkjmdg$30kff$1@dont-email.me> <vl93dl$3vkun$1@dont-email.me>
 <vl9449$3vo6h$3@dont-email.me> <vl9aov$pp7$1@dont-email.me>
 <vla4hr$5n4v$1@dont-email.me> <vlblqj$harb$1@dont-email.me>
 <lttopaFoh2cU8@mid.individual.net> <vle8uk$12sii$2@dont-email.me>
 <c686fb74-4fac-0809-7005-417c76ee0e3b@example.net>
 <nbReP.633803$oR74.271654@fx16.iad> <NnVeP.44028$vfee.11890@fx45.iad>
 <vo6ubb$3ue2q$2@dont-email.me>
 <RhOdnY5Kb8vulDr6nZ2dnZfqnPudnZ2d@earthlink.com>
 <vo7lp6$25uo$2@dont-email.me>
 <655acbf6-05e5-69ff-8a44-9f7075aafa2e@example.net>
 <ddNpP.567620$iNI.244105@fx14.iad> <m0pqs3ForauU2@mid.individual.net>
 <g9qcnUmy1pxdrTX6nZ2dnZfqnPqdnZ2d@earthlink.com>
 <m0r59mFrbnU1@mid.individual.net> <yn0qP.587031$iNI.359829@fx14.iad>
 <VtWdnaJY5fz99zT6nZ2dnZfqnPudnZ2d@earthlink.com>
 <20250210093054.00001375@gmail.com> <vofgo6$1p8fn$1@dont-email.me>
 <KwSdnd_yRPwhvjH6nZ2dnZfqnPidnZ2d@earthlink.com>
 <20250212081704.00003ce1@gmail.com> <vokorq$2t8mq$2@dont-email.me>
 <m175deFstueU1@mid.individual.net>
Reply-To: OFeem1987@teleworm.us
Injection-Date: Sat, 15 Feb 2025 13:31:34 +0100 (CET)
Injection-Info: dont-email.me; posting-host="51f904e9e1fb385a5faec4e487b71120";
	logging-data="31870"; mail-complaints-to="abuse@eternal-september.org";	posting-account="U2FsdGVkX19sKaUWhaRoSou/AcQjukgK"
User-Agent: slrn/1.0.3 (Linux)
Cancel-Lock: sha1:ijsnBUFz1LGv2zAqvbOj0d9B/+8=
X-Mutt: The most widely-used MUA
X-Face: 63n<76,LYJQ2m#'5YL#.T95xqyPiG`ffIP70tN+j"(&@6(4l\7uL)2+/-r0)/9SjZ`qw=
 Njn mr93Xrerx}aQG-Ap5IHn"xe;`5:pp"$RH>Kx_ngWw%c\+6qSg!q"41n2[.N/;Pu6q8?+Poz~e
 A9? $6_R7cm.l!s8]yfv7x+-FYQ|/k
X-User-Agent: Microsoft Outl00k, Usenet K00k Editions
X-Slrn: Why use anything else?
Bytes: 3053

rbowman wrote this post while blinking in Morse code:

> On Thu, 13 Feb 2025 07:34:02 -0500, Chris Ahlstrom wrote:
>
>>     std::array<int, 5> arr = {1, 2, 3, 4, 5};
>>     for (int element : arr)
>>         std::cout << element << " ";
>
> I don't think you could do that in the C++ I'm familiar with. You had an 
> iterator and then *. **. and so forth to get at what you wanted from it. 
> It was a beautiful piece of code when you started nesting iterators.

The only time you NEED the iterator version (as opposed to the range-for above)
is when you want to erase elements.

Also, you can shorten (obfuscate?) that even more:

       std::array<int, 5> arr {1, 2, 3, 4, 5};
       for (auto element : arr)
           std::cout << element << " ";

Though "auto" is more useful for complex data types.

-- 
QOTD:
	"The elder gods went to Suggoth and all I got was this lousy T-shirt."