c++ Programming Glossary: get_vector
What does auto&& tell us? http://stackoverflow.com/questions/13230480/what-does-auto-tell-us std vector int global_vec 1 2 3 4 template typename T T get_vector return global_vec template typename T void foo auto vec get_vector.. return global_vec template typename T void foo auto vec get_vector T auto i std begin vec i std cout vec 0 std endl Here get_vector.. T auto i std begin vec i std cout vec 0 std endl Here get_vector T is that lovely expression that could be either an lvalue or..
Proper way (move semantics) to return a std::vector from function calling in C++11 http://stackoverflow.com/questions/6211575/proper-way-move-semantics-to-return-a-stdvector-from-function-calling-in-c 1.Good looking ctor expensive performance std vector Foo get_vector int _n const Bar _m std vector Foo ret ... filling ret depending.. arguments return ret Foo Foo int _n const Bar _m fooes_ get_vector _n _m 2. Better performance worse looking ctor void fill_vector.. Bar _m fill_vector _n _m fooes_ Is it possible to rewrite get_vector function from 1st example with C 0x move semantics features..
|