[#absl-c_generate_n] = xref:absl.adoc[absl]::c_generate_n :relfileprefix: ../ :mrdocs: Container‐based version of the <algorithm> `std::generate_n()` function to assign a container's first N elements to the values provided by the given generator. == Synopsis Declared in `<absl/algorithm/container.h>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template< typename C, typename Size, typename Generator> constexpr /* implementation-defined */ c_generate_n( C& c, Size n, Generator&& gen); ---- == Return Value An iterator one past the last assigned element. == Parameters [cols="1,4"] |=== | Name| Description | *c* | The container to fill. | *n* | The number of elements to assign. | *gen* | The generator invoked to produce each value. |=== [.small]#Created with https://www.mrdocs.com[MrDocs]#