От: | Marty | https://www.youtube.com/channel/UChp5PpQ6T4-93HbNF-8vSYg | |
Дата: | 16.08.20 16:43 | ||
Оценка: |
template<typename ItemType>
inline
std::vector<ItemType>& push_back_helper( std::vector<ItemType> &v, const ItemType &elem )
{
v.push_back(elem);
return v;
}
inline
std::vector<int> makeVec( int i )
{
return push_back_helper( std::vector<int>(), i );
}
int main()
{
auto v = makeVec( 3 );
}