Math v0.0.1
uint2

Unsigned integer 2 component vector structure. More...

#include <uint.hpp>

Public Member Functions

constexpr uint2 (uint32 xy=0u) noexcept
 Creates a new unsigned integer 2 component vector structure.
 
constexpr uint2 (uint32 x, uint32 y) noexcept
 Creates a new unsigned integer 2 component vector structure.
 
uint32operator[] (psize i) noexcept
 Returns vector component by index.
 
uint32 operator[] (psize i) const noexcept
 Returns vector component by index.
 
constexpr operator uint32 () noexcept
 Returns first vector component value. (x)
 
constexpr uint2 operator+ (uint2 v) const noexcept
 
constexpr uint2 operator- (uint2 v) const noexcept
 
constexpr uint2 operator* (uint2 v) const noexcept
 
constexpr uint2 operator/ (uint2 v) const noexcept
 
constexpr uint2 operator% (uint2 v) const noexcept
 
constexpr uint2 operator& (uint2 v) const noexcept
 
constexpr uint2 operator| (uint2 v) const noexcept
 
constexpr uint2 operator^ (uint2 v) const noexcept
 
constexpr uint2 operator>> (uint2 v) const noexcept
 
constexpr uint2 operator<< (uint2 v) const noexcept
 
constexpr uint2 operator+ (uint32 n) const noexcept
 
constexpr uint2 operator- (uint32 n) const noexcept
 
constexpr uint2 operator* (uint32 n) const noexcept
 
constexpr uint2 operator/ (uint32 n) const noexcept
 
constexpr uint2 operator% (uint32 n) const noexcept
 
constexpr uint2 operator& (uint32 n) const noexcept
 
constexpr uint2 operator| (uint32 n) const noexcept
 
constexpr uint2 operator^ (uint32 n) const noexcept
 
constexpr uint2 operator>> (uint32 n) const noexcept
 
constexpr uint2 operator<< (uint32 n) const noexcept
 
constexpr uint2 operator- () const noexcept
 
constexpr uint2 operator! () const noexcept
 
constexpr uint2 operator~ () const noexcept
 
uint2operator+= (uint2 v) noexcept
 
uint2operator-= (uint2 v) noexcept
 
uint2operator*= (uint2 v) noexcept
 
uint2operator/= (uint2 v) noexcept
 
uint2operator%= (uint2 v) noexcept
 
uint2operator&= (uint2 v) noexcept
 
uint2operator|= (uint2 v) noexcept
 
uint2operator^= (uint2 v) noexcept
 
uint2operator>>= (uint2 v) noexcept
 
uint2operator<<= (uint2 v) noexcept
 
uint2operator+= (uint32 n) noexcept
 
uint2operator-= (uint32 n) noexcept
 
uint2operator*= (uint32 n) noexcept
 
uint2operator/= (uint32 n) noexcept
 
uint2operator%= (uint32 n) noexcept
 
uint2operator&= (uint32 n) noexcept
 
uint2operator|= (uint32 n) noexcept
 
uint2operator^= (uint32 n) noexcept
 
uint2operator>>= (uint32 n) noexcept
 
uint2operator<<= (uint32 n) noexcept
 
uint2operator= (uint32 n) noexcept
 
constexpr bool operator== (uint2 v) const noexcept
 
constexpr bool operator!= (uint2 v) const noexcept
 
constexpr uint2 operator< (uint2 v) const noexcept
 
constexpr uint2 operator> (uint2 v) const noexcept
 
constexpr uint2 operator<= (uint2 v) const noexcept
 
constexpr uint2 operator>= (uint2 v) const noexcept
 
constexpr bool operator== (uint32 n) const noexcept
 
constexpr bool operator!= (uint32 n) const noexcept
 
constexpr uint2 operator< (uint32 n) const noexcept
 
constexpr uint2 operator> (uint32 n) const noexcept
 
constexpr uint2 operator<= (uint32 n) const noexcept
 
constexpr uint2 operator>= (uint32 n) const noexcept
 

Public Attributes

uint32 x
 
uint32 y
 

Static Public Attributes

static const uint2 zero = uint2(0u)
 
static const uint2 one = uint2(1u)
 

Detailed Description

Unsigned integer 2 component vector structure.

Commonly used to represent: points, positions, etc.

Constructor & Destructor Documentation

◆ uint2() [1/2]

constexpr uint2 ( uint32 xy = 0u)
inlineexplicitconstexprnoexcept

Creates a new unsigned integer 2 component vector structure.

Parameters
xytarget value for all vector components

◆ uint2() [2/2]

constexpr uint2 ( uint32 x,
uint32 y )
inlineconstexprnoexcept

Creates a new unsigned integer 2 component vector structure.

Parameters
xfirst vector component value
ysecond vector component value

Member Function Documentation

◆ operator[]() [1/2]

uint32 & operator[] ( psize i)
inlinenoexcept

Returns vector component by index.

Parameters
itarget component index

◆ operator[]() [2/2]

uint32 operator[] ( psize i) const
inlinenoexcept

Returns vector component by index.

Parameters
itarget component index

Member Data Documentation

◆ x

uint32 x

First vector component.

◆ y

uint32 y

Second vector component.