1.3.49
 
Loading...
Searching...
No Matches
helios::int2 Struct Reference

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.
 
int2operator+= (const int2 &a) noexcept
 Increment int2 vector.
 
int2operator-= (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.
 

Detailed Description

Vector of two elements of type 'int'.

Definition at line 44 of file helios_vector_types.h.

Constructor & Destructor Documentation

◆ int2() [1/4]

constexpr helios::int2::int2 ( )
inlineconstexpr

Default constructor.

Definition at line 53 of file helios_vector_types.h.

◆ int2() [2/4]

helios::int2::int2 ( const std::vector< int > &  v)
inlineexplicit

Construct int2 from a vector of ints.

Definition at line 57 of file helios_vector_types.h.

◆ int2() [3/4]

constexpr helios::int2::int2 ( const int  v[2])
inlineexplicitconstexpr

Construct int2 from an array of ints.

Definition at line 65 of file helios_vector_types.h.

◆ int2() [4/4]

constexpr helios::int2::int2 ( int  v0,
int  v1 
)
inlineconstexpr

Construct int2 from two ints.

Definition at line 69 of file helios_vector_types.h.

Member Function Documentation

◆ operator!=()

constexpr bool helios::int2::operator!= ( const int2 a) const
constexprnoexcept

Inequality for all elements.

Definition at line 137 of file helios_vector_types.h.

◆ operator+()

constexpr int2 helios::int2::operator+ ( const int2 a) const
constexprnoexcept

Add two int2 vectors.

Definition at line 113 of file helios_vector_types.h.

◆ operator+=()

int2 & helios::int2::operator+= ( const int2 a)
inlinenoexcept

Increment int2 vector.

Definition at line 117 of file helios_vector_types.h.

◆ operator-() [1/2]

constexpr int2 helios::int2::operator- ( ) const
constexprnoexcept

Multiply each element by -1.

Definition at line 141 of file helios_vector_types.h.

◆ operator-() [2/2]

constexpr int2 helios::int2::operator- ( const int2 a) const
constexprnoexcept

Subtract two int2 vectors.

Definition at line 129 of file helios_vector_types.h.

◆ operator-=()

int2 & helios::int2::operator-= ( const int2 a)
inlinenoexcept

Decrement int2 vector.

Definition at line 123 of file helios_vector_types.h.

◆ operator==()

constexpr bool helios::int2::operator== ( const int2 a) const
constexprnoexcept

Equality for all elements.

Definition at line 133 of file helios_vector_types.h.

Friends And Related Symbol Documentation

◆ operator<<

std::ostream & operator<< ( std::ostream &  os,
const helios::int2 vec 
)
friend

Write int2 to output stream.

Definition at line 89 of file helios_vector_types.h.

Field Documentation

◆ x

int helios::int2::x

First element in vector.

Definition at line 47 of file helios_vector_types.h.

◆ y

int helios::int2::y

Second element in vector.

Definition at line 49 of file helios_vector_types.h.


The documentation for this struct was generated from the following file: