-
Notifications
You must be signed in to change notification settings - Fork 0
fill
Ned Bingham edited this page Mar 8, 2017
·
26 revisions
template <class value_type> struct fill
Stores a counted number of duplicate elements.
-
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.
-
fill(int count, value_type value)
setscount
andvalue
directly. -
fill(const_iterator left, const_iterator right)
whereleft
andright
demarcate the bounds of another fill container. This setscount
toright-left
andvalue
to the value pointed to byleft
.
Basic functions necessary for algorithm execution.
-
int size()
returns the value ofcount
.
-
const_iterator begin()
returns an iterator to the first element. -
const_iterator end()
returns an iterator to one after the last element. -
const_iterator rbegin()
returns an iterator to the last element. -
const_iterator rend()
returns an iterator to one before the first element. -
const_iterator at(int i)
returns an iterator to thei
th element.
-
value_type front()
returnsvalue
. -
value_type back()
returnsvalue
. -
value_type get(int i)
returnsvalue
-
value_type operator[](int i)
returnsvalue
Compares two fill containers by comparing value
followed by count
.
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 a fill container to a generic slice by callingcompare()
. 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)
#include <std/ascii_stream.h>
#include <std/fill.h>
using namespace core;
int main()
{
fill<int> f(0, 10);
cout << f << endl;
return 0;
}