Hi Andrey,<br><br>you can pass list by value. Compiler should be smart enough to eliminate the temporary.<br>On the other hand, if you vector is always constant consider using a fusion vector.<br><br>You can also introduce a helper function, which fills the vector with the desired list<br> and returns it:<br><br>struct sss<br>{<br>�� sss()<br>���� : v(vector_items)<br>�� {}<br><br>private:<br>�� // this function should be inlined with temporary elimination<br>�� static vector<int> vector_items()<br>�� {<br> ����� vector<int> v = list_of...;<br>����� return v;<br>�� }<br>};<br><br>Hope that helps,<br>Ovanes<br><br><br><div class="gmail_quote">On Wed, Mar 17, 2010 at 8:30 PM, Andrey Torba <span dir="ltr"><<a href="mailto:andreytorba@gmail.com">andreytorba@gmail.com</a>></span> wrote:<br> <blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><div class="im">On 17 March 2010 17:58, Ovanes Markarian <<a href="mailto:om_boost@keywallet.com">om_boost@keywallet.com</a>> wrote:<br> > vector<int> v(my_iterator(list_of(1)(2)), my_iterator());<br> <br> </div>I think that result of `list_of` will be�destroyed�after<br> `my_iterator(...)` call, so `my_iterator` will not be valid.<br> <font color="#888888"><br> <br> --<br> Regards, Andrey<br> _______________________________________________<br> Boost-users mailing list<br> <a href="mailto:Boost-users@lists.boost.org">Boost-users@lists.boost.org</a><br> <a href="http://lists.boost.org/mailman/listinfo.cgi/boost-users" target="_blank">http://lists.boost.org/mailman/listinfo.cgi/boost-users</a><br> </font></blockquote></div><br>