跳到主要内容

libraries/eosiolib/core/eosio/ignore.hpp

Namespaces

Name
eosio

Classes

Name
structeosio::ignore
structeosio::ignore_wrapper

Source code

#pragma once

#include "datastream.hpp"

namespace eosio {
template <typename T>
struct [[eosio::ignore]] ignore {};

template <typename T>
struct ignore_wrapper {
constexpr ignore_wrapper() {}
constexpr ignore_wrapper(T val) : value(val) {}
constexpr ignore_wrapper(ignore<T> val) {}
constexpr inline T get() { return value; }
constexpr operator T() { return value; }
constexpr operator ignore<T>() { return {}; }
T value;
};

template<typename DataStream, typename T>
inline DataStream& operator<<(DataStream& ds, const ::eosio::ignore_wrapper<T>& val) {
ds << val.value;
return ds;
}

template<typename DataStream, typename T>
inline DataStream& operator<<(DataStream& ds, const ::eosio::ignore<T>& val) {
return ds;
}

template<typename DataStream, typename T>
inline DataStream& operator>>(DataStream& ds, ::eosio::ignore<T>&) {
return ds;
}
}

Updated on 2022-12-05 at 15:38:08 +0000