|
tgen
|
List value. More...

Public Member Functions | |
| value (const std::vector< T > &vec) | |
| Creates a list value from a std::vector. | |
| int | size () const |
| Returns the size of the list value. | |
| T & | operator[] (int idx) |
| Accesses the value at some position of the value. | |
| value & | sort () |
| Sorts the value in non-decreasing order. | |
| value & | reverse () |
| Reverses the value. | |
| value & | separator (char sep) |
| Sets separator for printing. | |
| value | operator+ (const value &rhs) |
| Concatenates two values. | |
| auto | to_std () const |
| Converts the value to a std::vector. | |
| Public Member Functions inherited from tgen::gen_value_base< value > | |
| bool | operator< (const value &rhs) const |
Friends | |
| std::ostream & | operator<< (std::ostream &out, const value &inst) |
| Prints the value to a std::ostream. | |
List value.
It can be deterministically operated upon (see Generator Value Operations for random operations) and printed through std::cout.
|
inline |
Creates a list value from a std::vector.
| vec | The std::vector representing the value. |
|
inline |
Concatenates two values.
| rhs | The right-hand side. |
Linear.
|
inline |
Accesses the value at some position of the value.
| idx | Index to be accessed. |
|
inline |
Reverses the value.
O(n).
|
inline |
Sets separator for printing.
O(1).
|
inline |
Returns the size of the list value.
|
inline |
Sorts the value in non-decreasing order.
O(n log n).
|
inline |
Converts the value to a std::vector.
|
friend |