This is a microoptimisation to call the relevant _M_assign_dispatch
function directly (because we know we have iterators), rather than
calling assign() to do the dispatching.

        * include/bits/stl_list.h (assign(initializer_list<value_type>)): Call
        _M_assign_dispatch directly with correct tag.

Tested powerpc64le-linux, committed to trunk.
commit 72d50c42a61a1627d54e0213b5112575950063ba
Author: redi <redi@138bc75d-0d04-0410-961f-82ee72b054a4>
Date:   Tue Oct 11 10:33:41 2016 +0000

    Optimise std::list::assign(initializer_list<T>) slightly
    
        * include/bits/stl_list.h (assign(initializer_list<value_type>)): Call
        _M_assign_dispatch directly with correct tag.
    
    git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@240984 
138bc75d-0d04-0410-961f-82ee72b054a4

diff --git a/libstdc++-v3/include/bits/stl_list.h 
b/libstdc++-v3/include/bits/stl_list.h
index 40e2d18..87c8a39 100644
--- a/libstdc++-v3/include/bits/stl_list.h
+++ b/libstdc++-v3/include/bits/stl_list.h
@@ -830,7 +830,7 @@ _GLIBCXX_BEGIN_NAMESPACE_CXX11
        */
       void
       assign(initializer_list<value_type> __l)
-      { this->assign(__l.begin(), __l.end()); }
+      { this->_M_assign_dispatch(__l.begin(), __l.end(), __false_type()); }
 #endif
 
       /// Get a copy of the memory allocation object.

Reply via email to