Counter

Data size counter.

Does not store anything.

Members

Functions

count
size_t count()

Data count.

put
void put(Range items)
put
void put(U item)

Variables

_count
size_t _count;

Examples

Counter!char counter;
counter.put("Ми");
assert(counter.count == 4);
counter.put('р'); // Cyrillic 
assert(counter.count == 6);
Counter!wchar counter;
counter.put("Ми");
assert(counter.count == 2);
counter.put('р'); // Cyrillic
assert(counter.count == 3);
Counter!int counter;
import std.algorithm: until;
counter.put([1, 2, 3, 4, 5].until(3));

Meta