Modern C++ for C Programmers: part 5
1–10 of 82 posts
Re: Modern C++ for C Programmers: part 5
#2Re: Modern C++ for C Programmers: part 5
#3Re: Modern C++ for C Programmers: part 5
#4Return value optimization is absolutely allowed in C, and ~all compilers do it. It's not commonly talked about because in C, there can be no side-effects when constructing or copying a struct, so there's nothing to discuss. It just happens automatically and there's no observable change in program behavior.
Re: Modern C++ for C Programmers: part 5
#5Previous parts: https://news.ycombinator.com/item?id=17309654 https://ds9a.nl/articles/posts/cpp-2/ https://ds9a.nl/articles/posts/cpp-3/ https://ds9a.nl/articles/posts/cpp-4/
Re: Modern C++ for C Programmers: part 5
#6Re: Modern C++ for C Programmers: part 5
#7Re: Modern C++ for C Programmers: part 5
#8Return value optimization is absolutely allowed in C, and ~all compilers do it. It's not commonly talked about because in C, there can be no side-effects when constructing or copying a struct, so there's nothing to discuss. It just happens automatically and there's no observable change in program behavior.
Re: Modern C++ for C Programmers: part 5
#9Re: Modern C++ for C Programmers: part 5
#10Is that true? I thought move ctor enabled move semantics, but if you pass by value the copy ctor was still called (except in places where RVO makes sense). And I thought to disable copying you made the copy ctor = delete.