return-value-optimization
Return value copying issue (to improve debug timing) -- What's the solution here?
The most interesting C++ question I\'ve encountered recently goes as follows: We determined (through profiling) that our algorithm spends a lot of time in debug mode in MS Visual Studio 2005 with fun[详细]
2023-04-06 15:16 分类:问答C++ returning an object throw an interface
I want to design a common interface which has a method that let me multiply two object which has this interface, returning a new object of the same class as the result. In order to keep it easy, I\'m[详细]
2023-03-19 23:18 分类:问答Will the c++ compiler optimize away unused return value by `reference`?
Before someone jumps and says Profile before optimize!, this is simply a curiosity question and stems from this original question.[详细]
2023-03-15 17:35 分类:问答Move or Named Return Value Optimization (NRVO)?
Lets say we have the following code: std::vector<int> f() { std::vector<int> y; ... return y; }[详细]
2023-03-10 03:01 分类:问答Why are by-value parameters excluded from NRVO?
Imagine: S f(S a) { return a; } Why is it not allowed to alias a and the return value slot? S s = f(t); S s = t; // can\'t generally transform it to this :([详细]
2023-03-06 05:54 分类:问答Copy-elision of automatic variable for return
I am wondering if in C++0x \"12.8 C开发者_如何学Copying and Moving class objects [class.copy] paragraph 31\" when copy elision happens, exactly:[详细]
2023-02-28 22:19 分类:问答RVO/NRVO and public undefined copy constructor
I\'m fighting the following proposal now, and I want to know legal and for lesser extent moral arguments against it or for it.[详细]
2023-02-22 09:18 分类:问答Return value optimization of values unpacked from std::tuple
Are there any compilers capable of performing return value optimization on multiple values returned from a function through std::tupl开发者_开发问答e? To be clear, in the following code, are there any[详细]
2023-02-11 09:44 分类:问答How to return an fstream (C++0x)
I think I\'ll get right into it and start with the code: #include <iostream> #include <fstream>[详细]
2023-02-07 09:41 分类:问答STL swap on return?
sorry for such a long question but I try to be as clear as possi开发者_如何学Goble. This somehow follows my previous question about strings in C++. I\'m trying to figure out how I could return std::st[详细]
2023-02-06 02:31 分类:问答