Pair¶
| Spice | |
|---|---|
Pair<V1, V2> struct¶
A pair in Spice is a commonly used data structure, which saves two values of arbitrary type together in a correlation
Constructors¶
ctor¶
| Spice | |
|---|---|
Construct a pair from two values
Parameters
| Name | Type | Description |
|---|---|---|
first |
V1 |
First value |
second |
V2 |
Second value |
Methods¶
getFirst¶
| Spice | |
|---|---|
Retrieve the first value of the pair
Returns: V1& — Reference to the first value
getSecond¶
| Spice | |
|---|---|
Retrieve the second value of the pair
Returns: V2& — Reference to the second value
setFirst¶
| Spice | |
|---|---|
Set the first value of the pair
Parameters
| Name | Type | Description |
|---|---|---|
first |
const V1& |
New first value |
setSecond¶
| Spice | |
|---|---|
Set the second value of the pair
Parameters
| Name | Type | Description |
|---|---|---|
second |
const V2& |
New second value |
Operators¶
operator==¶
| Spice | |
|---|---|
Check if two pairs are equal, i.e. both of their values are equal
Parameters
| Name | Type | Description |
|---|---|---|
lhs |
const Pair<V1, V2>& |
|
rhs |
const Pair<V1, V2>& |
Returns: bool — Equal or not equal
operator!=¶
| Spice | |
|---|---|
Check if two pairs are not equal
Parameters
| Name | Type | Description |
|---|---|---|
lhs |
const Pair<V1, V2>& |
|
rhs |
const Pair<V1, V2>& |
Returns: bool — Not equal or equal