
Zhang, Karl writes:
Hi:
When I am reading mpl source code. I notice that push_bck algorithm, Look as following:
template<> struct push_back_traits< aux::vector_tag > { template< typename Vector, typename T > struct algorithm { typedef vector_node<T,Vector> type; }; };
My question is: when generate new sequence, vactor_node<T, vector>, why skip "size" argument ? How does it increase sequence size in push_back?
About push_front, It increase sequence size when generating new sequence.
Karl, Are you looking at pre-1.32 version of the library? Things have changed quite a bit since then, and I'm afraid I don't remember the details of the older versions of the code that well by now. It might have been that the 'size' argument was only present in one of the two alternative vector implementations and the said difference between 'push_front' and 'push_back' was in fact a difference between two different implementation strategies, which would be quite easy to miss unless you are deeply familiar with the code. Generally, it's much easier for me to answer questions about library implementation if they refer to the code in the latest release. -- Aleksey Gurtovoy MetaCommunications Engineering