C++ Logo


Advanced search

Re: [std-proposals] Array Index in Range-based For Loops

From: Jason McKesson <jmckesson_at_[hidden]>
Date: Fri, 3 Mar 2023 14:38:52 -0500
On Fri, Mar 3, 2023 at 1:08 PM Andrey Semashev via Std-Proposals
<std-proposals_at_[hidden]> wrote:
> On 3/3/23 19:52, Jason McKesson via Std-Proposals wrote:
> > On Fri, Mar 3, 2023 at 4:53 AM Andrey Semashev via Std-Proposals
> > <std-proposals_at_[hidden]> wrote:
> >> or if `import std` is more expensive than `#include <cstddef>` (or pick any
> >> other lightweight header)
> >
> > We already have an answer to this. There's evidence, from the compiler
> > that supports a standard library import, that it is close to an order
> > of magnitude faster to `import std;` than to include even one header.
> > The evidence is listed in P2412.
> While this is better than nothing (thanks for sharing the reference to
> the proposal), this is just one implementation on a platform that is
> infamous for its slow filesystem. Given the history with precompiled
> headers, which offered a significant speedup with MSVC on Windows and
> nearly no benefit on other platforms, I'll keep my reservations until I
> see numbers on other platforms and implementations.
> > I know there are a lot of questions about modules out there. But
> > people keep reraising these questions as if there aren't already
> > answers to at least some of them.
> I would say, that's because finding this kind of information is
> virtually impossible unless you follow closely the particular proposals
> or on the discussions on the MLs and reflectors.

Or, you know, watch presentations at C++ conferences about the subject
(https://www.youtube.com/watch?v=0f5N1JKo4D4). Finding information is
only "virtually impossible" if you don't bother to look for it. I know
Google is pretty broken these days for finding real information, but
this stuff is not hiding.

Received on 2023-03-03 19:39:40