Now looking into largely obsolete library facilities... Starting from `ScopedHolder`, I found a surprising problem with ''perfect forwarding....'' ...which however turned out to be the result of ''sloppy programming'' on my side. At that time, in 2017, seemingly I was under pressure to define a Session-Command, which captures a Time-entity as »State Memento«. Which turned out to be impossible, since the Time entities were conceived as being immutable -- a questionable design decision (see #1261), which already generated quite some additional complexities. In the course of this »exercise«, I could again clarify that the implementation of perfect forwarding works as expected on modern compilers — confusion may arrise sometimes due to ''copy elision'' (which the compiler is required to perform since C++17, even when the elided constructor has observable side effects). And it can be derailed when (as was the case here) a »grab everything« constructor accidentally ends up generating a copy- or move-constructor for the container class itself. This is an instance of the problem documented with #963 ... .... and the best solution is to abide by the rule-of-five (and a half) and to put that `ReplacableItem` to where it belongs...
9.5 MiB
9.5 MiB
| The file is too large to be shown. |