Skip to content

Class endstone::nbt::ValueTag

template <typename T>

ClassList > endstone > nbt > ValueTag

An NBT tag wrapping a single scalar payload of type T (e.g. More...

  • #include <endstone/nbt/value.h>

Inherits the following classes: endstone::nbt::TagBase

Public Types

Type Name
typedef T value_type

Public Functions

Type Name
constexpr ValueTag () = default
constexpr ValueTag (const T & v)
Construct a value tag from a copy of the given payload.
constexpr ValueTag (T && v)
Construct a value tag by moving the given payload.
operator const T & () noexcept const
Implicitly converts to a read-only reference to the underlying payload.
const T & value () noexcept const
Get the underlying payload.

Detailed Description

byte, int, float, string).

Template parameters:

  • T the underlying payload type

Public Types Documentation

typedef value_type

using endstone::nbt::ValueTag< T >::value_type =  T;

Public Functions Documentation

function ValueTag [⅓]

constexpr endstone::nbt::ValueTag::ValueTag () = default

function ValueTag [⅔]

Construct a value tag from a copy of the given payload.

inline explicit constexpr endstone::nbt::ValueTag::ValueTag (
    const  T & v
) 

Parameters:

  • v the payload value

function ValueTag [3/3]

Construct a value tag by moving the given payload.

inline explicit constexpr endstone::nbt::ValueTag::ValueTag (
    T && v
) 

Parameters:

  • v the payload value

function operator const T &

Implicitly converts to a read-only reference to the underlying payload.

inline endstone::nbt::ValueTag::operator const T & () noexcept const


function value

Get the underlying payload.

inline const  T & endstone::nbt::ValueTag::value () noexcept const

Returns:

a reference to the wrapped value


Friends Documentation

friend operator!=

inline constexpr  bool endstone::nbt::ValueTag::operator!= (
    const  ValueTag & a,
    const  ValueTag & b
) noexcept

friend operator!=

inline constexpr  bool endstone::nbt::ValueTag::operator!= (
    const  ValueTag & a,
    const  T & b
) noexcept

friend operator!=

inline constexpr  bool endstone::nbt::ValueTag::operator!= (
    const  T & a,
    const  ValueTag & b
) noexcept

friend operator==

inline constexpr  bool endstone::nbt::ValueTag::operator== (
    const  ValueTag & a,
    const  ValueTag & b
) noexcept

friend operator==

inline constexpr  bool endstone::nbt::ValueTag::operator== (
    const  ValueTag & a,
    const  T & b
) noexcept

friend operator==

inline constexpr  bool endstone::nbt::ValueTag::operator== (
    const  T & a,
    const  ValueTag & b
) noexcept


The documentation for this class was generated from the following file include/endstone/nbt/value.h