v8  9.4.146 (node 16.15.0)
V8 is Google's open source JavaScript engine
MemorySpan< T > Class Template Reference

#include <v8.h>

Public Member Functions

constexpr MemorySpan ()=default
constexpr MemorySpan (T *data, size_t size)
constexpr T * data () const
constexpr size_t size () const

Detailed Description

template<typename T>
class v8::MemorySpan< T >

Points to an unowned continous buffer holding a known number of elements.

This is similar to std::span (under consideration for C++20), but does not require advanced C++ support. In the (far) future, this may be replaced with or aliased to std::span.

To facilitate future migration, this class exposes a subset of the interface implemented by std::span.

Definition at line 5048 of file v8.h.

Constructor & Destructor Documentation

◆ MemorySpan() [1/2]

constexpr MemorySpan ( )

The default constructor creates an empty span.

Referenced by FunctionTemplate::NewWithCFunctionOverloads(), and FunctionTemplate::SetCallHandler().

◆ MemorySpan() [2/2]

constexpr MemorySpan ( T *  data,
size_t  size 

Definition at line 5053 of file v8.h.

Member Function Documentation

◆ data()

constexpr T* data ( ) const

Returns a pointer to the beginning of the buffer.

Definition at line 5056 of file v8.h.

◆ size()

constexpr size_t size ( ) const

Returns the number of elements that the buffer holds.

Definition at line 5058 of file v8.h.

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