How to fill a vector with non-trivial initial values?

后端 未结 6 1491
一向
一向 2021-02-05 12:38

I know how to fill an std::vector with non-trivial initial values, e.g. sequence numbers:

void IndexArray( unsigned int length, std::vector&a         


        
6条回答
  •  既然无缘
    2021-02-05 13:18

    There is also a iota() function in adobe.ASL, (and a value_iterator as well). In boost, there is a counting_iterator, and I suspect a few other ways to do generate number sequences on the fly in boost.

提交回复
热议问题