AsmGrader 0.0.0
Loading...
Searching...
No Matches
asmgrader::Byte Class Reference

More user-friendly interface wrapper for a byte-like integral. More...

#include <byte.hpp>

Public Member Functions

constexpr Byte ()=default
 
 explicit (false) const expr Byte(u8 val)
 
 explicit (false) const expr Byte(std
 
template<std::integral Narrowable>
requires (!std::same_as<Narrowable, u8>)
 explicit (false) const eval Byte(Narrowable val)
 Implicit compile-time narrowing conversion this means something like Byte{1000} would fail to compile, which is what one should expect.
 
constexpr operator u8 () const
 Explicit conversion to u8.
 
constexpr operator std::byte () const
 Explicit conversion to std::byte.
 
constexpr bool operator== (const Byte &rhs) const =default
 Compiler generated equality operator with another Byte
 
constexpr auto operator<=> (const Byte &rhs) const =default
 Compiler generated comparison operators with another Byte
 
constexpr Byte operator~ () const
 Unary bitwise not.
 

Static Public Member Functions

template<std::integral Narrowable>
static constexpr Byte narrow_from (Narrowable val)
 Attempt to perform a narrowing conversion from val to a Byte.
 

Public Attributes

u8 value {}
 Bitwise or.
 

Detailed Description

More user-friendly interface wrapper for a byte-like integral.

Constructor & Destructor Documentation

◆ Byte()

asmgrader::Byte::Byte ( )
constexprdefault

Member Function Documentation

◆ explicit() [1/3]

template<std::integral Narrowable>
requires (!std::same_as<Narrowable, u8>)
asmgrader::Byte::explicit ( false ) const
inline

Implicit compile-time narrowing conversion this means something like Byte{1000} would fail to compile, which is what one should expect.

Wraps narrow_from

◆ explicit() [2/3]

asmgrader::Byte::explicit ( false ) const
inline

◆ explicit() [3/3]

asmgrader::Byte::explicit ( false ) const
inline

◆ narrow_from()

template<std::integral Narrowable>
static constexpr Byte asmgrader::Byte::narrow_from ( Narrowable val)
inlinestaticconstexpr

Attempt to perform a narrowing conversion from val to a Byte.

Exceptions
out_of_range

◆ operator std::byte()

asmgrader::Byte::operator std::byte ( ) const
inlineexplicitconstexpr

Explicit conversion to std::byte.

◆ operator u8()

asmgrader::Byte::operator u8 ( ) const
inlineexplicitconstexpr

Explicit conversion to u8.

◆ operator<=>()

auto asmgrader::Byte::operator<=> ( const Byte & rhs) const
constexprdefault

Compiler generated comparison operators with another Byte

◆ operator==()

bool asmgrader::Byte::operator== ( const Byte & rhs) const
constexprdefault

Compiler generated equality operator with another Byte

◆ operator~()

Byte asmgrader::Byte::operator~ ( ) const
inlineconstexpr

Unary bitwise not.

Member Data Documentation

◆ value

u8 asmgrader::Byte::value {}

Bitwise or.

Bitwise and Bitwise xor Bitwise right shift Bitwise left shift Bitwise or assign Bitwise and assign Bitwise xor assign Bitwise right shift assign Bitwise left shift assign


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