r/cpp • u/stanimirov • Jul 04 '18
Be Mindful with Compiler-Generated Move Constructors
https://ibob.github.io/blog/2018/07/03/compiler-generated-move/
88
Upvotes
r/cpp • u/stanimirov • Jul 04 '18
View all comments
Show parent comment
9
u/stanimirov Jul 04 '18
The thing is that the small buffer optimizations can be enabled *only* for noexcept-movable functions (which I assume is the vast majority). And, as commenters in Cpplang Slack pointed out, this is indeed the case with the newer implementations of both libc++ and libstdc++ (which come with gcc 6+ and clang 5+). It is (still) not the case, though, with the standard library which comes with MSVC