DOC HOME SITE MAP MAN PAGES GNU INFO SEARCH PRINT BOOK
 

fill(3C++)


fill -- assign a given value to all locations in an array

Synopsis

   template <class T>
   void fill(const T& val,T* b,T* e);

Assumptions

(1) T has operator=.

Description

Assigns the value val to every location in the array.

Complexity

If N is the size of the array, then complexity is O(N). Exactly N assignments are done.

Notes

Because a Block (see Block(3C++)) can always be used wherever an array is called for, Array Algorithms can also be used with Blocks. In fact, these two components were actually designed to be used together.

References

Array_alg(3C++), for_each(3C++), generate(3C++), subs(3C++), Block(3C++)
© 2004 The SCO Group, Inc. All rights reserved.
UnixWare 7 Release 7.1.4 - 25 April 2004