Vector of two elements of type 'int'. More...
#include <helios_vector_types.h>
Public Member Functions | |
constexpr | int2 () |
Default constructor. | |
int2 (const std::vector< int > &v) | |
Construct int2 from a vector of ints. | |
constexpr | int2 (const int v[2]) |
Construct int2 from an array of ints. | |
constexpr | int2 (int v0, int v1) |
Construct int2 from two ints. | |
constexpr int2 | operator+ (const int2 &a) const noexcept |
Add two int2 vectors. | |
int2 & | operator+= (const int2 &a) noexcept |
Increment int2 vector. | |
int2 & | operator-= (const int2 &a) noexcept |
Decrement int2 vector. | |
constexpr int2 | operator- (const int2 &a) const noexcept |
Subtract two int2 vectors. | |
constexpr bool | operator== (const int2 &a) const noexcept |
Equality for all elements. | |
constexpr bool | operator!= (const int2 &a) const noexcept |
Inequality for all elements. | |
constexpr int2 | operator- () const noexcept |
Multiply each element by -1. | |
Data Fields | |
int | x |
First element in vector. | |
int | y |
Second element in vector. | |
Friends | |
std::ostream & | operator<< (std::ostream &os, const helios::int2 &vec) |
Write int2 to output stream. | |
Vector of two elements of type 'int'.
Definition at line 44 of file helios_vector_types.h.
|
inlineconstexpr |
Default constructor.
Definition at line 53 of file helios_vector_types.h.
|
inlineexplicit |
Construct int2 from a vector of ints.
Definition at line 57 of file helios_vector_types.h.
|
inlineexplicitconstexpr |
Construct int2 from an array of ints.
Definition at line 65 of file helios_vector_types.h.
|
inlineconstexpr |
Construct int2 from two ints.
Definition at line 69 of file helios_vector_types.h.
|
constexprnoexcept |
Inequality for all elements.
Definition at line 137 of file helios_vector_types.h.
Add two int2 vectors.
Definition at line 113 of file helios_vector_types.h.
Increment int2 vector.
Definition at line 117 of file helios_vector_types.h.
|
constexprnoexcept |
Multiply each element by -1.
Definition at line 141 of file helios_vector_types.h.
Subtract two int2 vectors.
Definition at line 129 of file helios_vector_types.h.
Decrement int2 vector.
Definition at line 123 of file helios_vector_types.h.
|
constexprnoexcept |
Equality for all elements.
Definition at line 133 of file helios_vector_types.h.
|
friend |
Write int2 to output stream.
Definition at line 89 of file helios_vector_types.h.
int helios::int2::x |
First element in vector.
Definition at line 47 of file helios_vector_types.h.
int helios::int2::y |
Second element in vector.
Definition at line 49 of file helios_vector_types.h.