STL list member function(S)
-
void assign(size_type n, el const T& el = T()) This function is a member function of the STL list class and I do not understand the bolded part. I understand the const T& el is a reference to a constant parameter which means I cannot change the value/content of the passed argument + I understand that el = T() means a default parameter so if there is no argument passed in the calling function the el will use the no-argument constructor of the T() type OK. But what make me confused the el at the beginning before the const?!!! so if someone can fill the blank gaps for me I will be grateful :). Thanks in advance.
-
void assign(size_type n, el const T& el = T()) This function is a member function of the STL list class and I do not understand the bolded part. I understand the const T& el is a reference to a constant parameter which means I cannot change the value/content of the passed argument + I understand that el = T() means a default parameter so if there is no argument passed in the calling function the el will use the no-argument constructor of the T() type OK. But what make me confused the el at the beginning before the const?!!! so if someone can fill the blank gaps for me I will be grateful :). Thanks in advance.
which compiler are you using? i haven't been able to find any std::list::assign definitions that look like that. http://www.cplusplus.com/reference/list/list/assign/[^], for both C++98 and C++11, has
void assign (size_type n, const value_type& val);
MSVC 8.0 has the same. so does the current MSDN (https://msdn.microsoft.com/en-us/library/w3eba3dd.aspx?f=255&MSPPError=-2147217396[^])
-
which compiler are you using? i haven't been able to find any std::list::assign definitions that look like that. http://www.cplusplus.com/reference/list/list/assign/[^], for both C++98 and C++11, has
void assign (size_type n, const value_type& val);
MSVC 8.0 has the same. so does the current MSDN (https://msdn.microsoft.com/en-us/library/w3eba3dd.aspx?f=255&MSPPError=-2147217396[^])
I read it in a book called "Data Structures and Algorithms in C++, 4th Edition by Adam Drozdek" it was in chapter 3 "Linked Lists" at the beginning of page 110 :). It made me had the feeling of this :wtf: :confused::~ when read it, and after searching and find nothing I become like this ;P;P;P (i.e., psycho). Thanks by the way for reply :)
-
I read it in a book called "Data Structures and Algorithms in C++, 4th Edition by Adam Drozdek" it was in chapter 3 "Linked Lists" at the beginning of page 110 :). It made me had the feeling of this :wtf: :confused::~ when read it, and after searching and find nothing I become like this ;P;P;P (i.e., psycho). Thanks by the way for reply :)