I found some interface for the list:开发者_运维问答 and there I found this constructor
template<typenameT>
...
list(size_tnum, constT& val = T());
...
can somebody explain what is this: constT& val = T()
thanks in advance
const T& val = T()
This describes a parameter that is taken by const reference, but is optional because the parameter is declared with an initialier. If not supplied then a value initialized temporary (T()
) is used.
The list
constructor you've found initializes a list
with num
copies of the val
parameter.
精彩评论