I've this simple function:
initializer_list<int> f(){return {1,2,3};}
g++ gives a warning saying:
warning: returning temporary initializer_list does not extend the lifetime of the underlying array [-Winit-list-lifetime]
Is there any risk to return an {1, 2, 3}
? Thanks for explanations!
Aucun commentaire:
Enregistrer un commentaire