I have one list like list<T> result; and in for loop I generate another list in every pass like
list<T> result;
for(int i=0;i<10;i++){
list<T> temp=generated_list();
// here I want to add at the beginning of the result list values from temp list
}
How to insert generated list at the beginning of the result list ? Is there better way than a loop or creating new by concatenation and then set result to result list ?
std::list<T>::splicemember function is most effcient way to do what you want to