2 #ifndef SYDEVS_IDENTITY_H_
3 #define SYDEVS_IDENTITY_H_
60 constexpr
bool valid()
const;
108 return index_ != nan_int64;
197 return index_ == rhs.index_;
204 return index_ != rhs.index_;
211 return index_ < rhs.index_;
218 return index_ > rhs.index_;
225 return index_ <= rhs.index_;
232 return index_ >= rhs.index_;
250 os <<
"{" << rhs.
index() <<
"}";
A data type which identifies an item by combining an encapsulated integer-valued index with a dimensi...
Definition: identity.h:42
static constexpr int64 nan_int64
Definition: identity.h:84
identity & operator++()
Increments (prefix) the internal index.
Definition: identity.h:120
identity & operator-=(int64 rhs)
Subtracts rhs from the identity value.
Definition: identity.h:166
constexpr bool valid() const
Returns true if the identity value is valid.
Definition: identity.h:106
constexpr bool operator<(identity rhs) const
Returns true if the identity value is less than rhs.
Definition: identity.h:209
constexpr bool operator<=(identity rhs) const
Returns true if the identity value is at most rhs.
Definition: identity.h:223
constexpr bool operator!=(identity rhs) const
Returns true if the identity value does not equal rhs.
Definition: identity.h:202
identity & operator--()
Decrements (prefix) the internal index.
Definition: identity.h:139
identity & operator=(const identity &)=default
Copy assignment.
constexpr const identity operator+() const
Returns a copy of the identity value.
Definition: identity.h:174
constexpr identity(const identity &)=default
Copy constructor.
identity(identity &&)=default
Move constructor.
~identity()=default
Destructor.
identity & operator=(identity &&)=default
Move assignment.
constexpr identity()
Constructs an invalid identity value.
Definition: identity.h:92
constexpr const identity operator-(int64 rhs) const
Returns a new identity value with rhs subtracted.
Definition: identity.h:188
constexpr bool operator==(identity rhs) const
Returns true if the identity value equals rhs.
Definition: identity.h:195
identity & operator+=(int64 rhs)
Adds rhs to the identity value.
Definition: identity.h:158
constexpr bool operator>=(identity rhs) const
Returns true if the identity value is at least rhs.
Definition: identity.h:230
constexpr bool operator>(identity rhs) const
Returns true if the identity value is greater than rhs.
Definition: identity.h:216
constexpr int64 index() const
Returns the internal index.
Definition: identity.h:113
auto operator+(const arraynd< T, ndims > &rhs)
Definition: arraynd.h:724
std::ostream & operator<<(std::ostream &os, const arraynd< T, ndims > &rhs)
Definition: arraynd.h:1158
int64_t int64
Definition: number_types.h:15