c++ - STL Algorithm for generating a vector -


I want to generate a vector using the STL algorithm to get the following

  Const int n1 = 10; // This is a content offset = 3; // also std :: vector & lt; Int & gt; Chans (10); For (size_t i = 0; i & lt; chans.size (); i ++) {chance [i] = offset + n1 * i; }  

Any suggestions?

14 with C ++:

  std :: generated (Chans.begin (), chans.end (), [=, calculation = 0] () instability {return offset + n1 * calculation ++;});  


Comments

Popular posts from this blog

apache - 504 Gateway Time-out The server didn't respond in time. How to fix it? -

c# - .net WebSocket: CloseOutputAsync vs CloseAsync -

c++ - How to properly scale qgroupbox title with stylesheet for high resolution display? -