Re[8]: ссылка на локальный вектор
От: _hum_ Беларусь  
Дата: 16.05.16 10:59
Оценка:
Здравствуйте, uzhas, Вы писали:

U>Здравствуйте, _hum_, Вы писали:



__>>а можно обоснованно, а не голословно?


U>по своей же ссылке читай отсюда: "Temporary objects are created in the following situations"

U>или обратись к Стандарту

замечательно. читаем:

Temporary object lifetime

Temporary objects are created in the following situations: binding a reference to a prvalue, returning a prvalue from a function, conversion that creates a prvalue, lambda expression, (since C++11) copy-initialization that requires conversion of the initializer, list-initialization that constructs an std::initializer_list, (since C++11) and reference-initialization to a different but convertible type or to a bitfield.


при создании const vector<float>& как раз-таки происходит конвертация из vector<float> tmp;
 
Подождите ...
Wait...
Пока на собственное сообщение не было ответов, его можно удалить.