-
Notifications
You must be signed in to change notification settings - Fork 0
fill
template <class value_type> struct fill
Stores a counted number of duplicate elements.
-
typedef value_type type
so that generic wrappers can access this containersvalue_type
-
typedef const_iterator iterator
so that algorithms dependent upon iterator work. - fill::const_iterator
-
value_type value
represents the value of all of the elements stored. -
int count
represents the number of elements this container stores.
Constructs a fill, initializing its contents depending on the constructor version used. There is no default constructor.
sets count
and value
directly.
where left
and right
demarcate the bounds of another fill container. This sets count
to right-left
and value
to the value pointed to by left
.
Basic functions necessary for algorithm execution.
returns the value of count
.
returns an iterator to the first element.
returns an iterator to one after the last element.
returns an iterator to the last element.
returns an iterator to one before the first element.
returns an iterator to the i
th element.
returns value
.
returns value
.
returns value
.
returns value
.
wraps this fill with a slice. This is particularly useful if an algorithm gives you a container filled with iterators. You can convert it into a slice with a single call to this function.
returns a slice of this container of the elements within the range [start
,end
).
returns a slice of this container of the elements after start
.
returns a slice of all the elements in this container.
returns a slice of all the elements within the range [start
,end
) of a fill container.
see above. This returns a copy instead of a slice.
see above. This returns a copy instead of a slice.
see above. This returns a copy instead of a slice.
uses the values of the fill container as indices into c
. Returns another fill container with the indexed value from c
.
This is the inverse of sample()
.
swaps the contents of this fill container with another.
sets the contents of this fill container equal the contents of another.
bool operator==(fill<value_type1> s1, fill<value_type2> s2)
bool operator!=(fill<value_type1> s1, fill<value_type2> s2)
bool operator<(fill<value_type1> s1, fill<value_type2> s2)
bool operator>(fill<value_type1> s1, fill<value_type2> s2)
bool operator<=(fill<value_type1> s1, fill<value_type2> s2)
bool operator>=(fill<value_type1> s1, fill<value_type2> s2)
Compares two fill containers by comparing value
followed by count
.
bool operator==(fill<value_type1> s1, core::slice<container2> s2)
bool operator!=(fill<value_type1> s1, core::slice<container2> s2)
bool operator<(fill<value_type1> s1, core::slice<container2> s2)
bool operator>(fill<value_type1> s1, core::slice<container2> s2)
bool operator<=(fill<value_type1> s1, core::slice<container2> s2)
bool operator>=(fill<value_type1> s1, core::slice<container2> s2)
bool operator==(core::slice<container1> s1, fill<value_type2> s2)
bool operator!=(core::slice<container1> s1, fill<value_type2> s2)
bool operator<(core::slice<container1> s1, fill<value_type2> s2)
bool operator>(core::slice<container1> s1, fill<value_type2> s2)
bool operator<=(core::slice<container1> s1, fill<value_type2> s2)
bool operator>=(core::slice<container1> s1, fill<value_type2> s2)
Compares a fill container to a generic slice by calling compare()
.
#include <std/ascii_stream.h>
#include <std/fill.h>
using namespace core;
int main()
{
fill<int> f(10, 5);
cout << f << endl;
return 0;
}
{5, 5, 5, 5, 5, 5, 5, 5, 5, 5}