Path: csiph.com!weretis.net!feeder8.news.weretis.net!eternal-september.org!reader01.eternal-september.org!.POSTED!not-for-mail From: Keith Thompson Newsgroups: comp.lang.c++ Subject: Re: What does "current time" mean? Date: Tue, 07 Feb 2023 12:00:31 -0800 Organization: None to speak of Lines: 30 Message-ID: <875ycddz4w.fsf@nosuchdomain.example.com> References: MIME-Version: 1.0 Content-Type: text/plain Injection-Info: reader01.eternal-september.org; posting-host="4db3b9aae9ba641a7bd7c831368aa4f5"; logging-data="4053810"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/9nlGXZHlFzMhvoKmOMlxR" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux) Cancel-Lock: sha1:xNdQXikJ0KV9qJ2ztjhhr1EIwUE= sha1:1cQcx5GHXuY88R1xTlovVYrmfDw= Xref: csiph.com comp.lang.c++:89022 scott@slp53.sl.home (Scott Lurndal) writes: > Manu Raju writes: >>Some of you might be interested in this paper by Amazon Engineer: >> >> > > Removing sequence points from the C++11 and following standards was > sure to bite. But C++11 still has this in [intro.execution]: Every value computation and side effect associated with a full-expression is sequenced before every value computation and side effect associated with the next full-expression to be evaluated. I would think that would make it illegal to reorder these statements (quoted from the paper); the calls to now(), fib(), and now() are full expressions. auto start = chrono::high_resolution_clock::now(); auto result = fib(which); auto end = chrono::high_resolution_clock::now(); It seems to me the author encountered a compiler bug, not a flaw in the language. -- Keith Thompson (The_Other_Keith) Keith.S.Thompson+u@gmail.com Working, but not speaking, for XCOM Labs void Void(void) { Void(); } /* The recursive call of the void */