GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • tensorstore
  • Tutorial
  • Indexing
  • API reference
  • API reference
  • E ContainerKind
  • C ByteStridedPointer
  • T element_type
  • T difference_type
  • V alignment
  • F ByteStridedPointer [default]
  • F ByteStridedPointer [raw]
  • F ByteStridedPointer [convert]
  • F get

This view

  • Original page
  • New address

GeezerVison is showing google.github.io — tensorstore::ByteStridedPointer - TensorStore

#include "tensorstore/util/byte_strided_pointer.h"
template <typename T>
class tensorstore::ByteStridedPointer;

Wrapper type for a raw pointer for which pointer arithmetic operates with a stride of 1 byte, rather than a stride of sizeof(T) bytes.

If the run-time type of the pointee is U, all byte offsets used for arithmetic MUST be a multiple of alignof(U).

Template Parameters:¶
typename T¶

The (possibly const-qualified) type of the pointee. It may be void or const void to indicate that the type is not known at compile time.

Types¶

using element_type = T;

Pointee type.

using difference_type = ptrdiff_t;

Pointer difference type, in bytes.

Data members¶

constexpr const size_t alignment =
    alignof(std::conditional_t<std::is_void_v<T>, char, T>);

Alignment required by T, or 1 if T is void.

Constructors¶

ByteStridedPointer();

Default initialization, leaves the wrapped raw pointer in an uninitialized state.

ByteStridedPointer(U* value);
explicit ByteStridedPointer(U* value);

Constructs from a compatible raw pointer.

ByteStridedPointer(ByteStridedPointer<U> value);
explicit ByteStridedPointer(ByteStridedPointer<U> value);

Converts from a compatible ByteStridedPointer type.

Accessors¶

T* get() const;

Converts to a raw pointer.

T* operator->() const;

Enables member access to the pointee.

U& operator*() const;

Dereferences the raw pointer.

operator T*() const;
explicit operator U*() const;

Converts to a raw pointer.

Arithmetic operations¶

ByteStridedPointer& operator+=(Integer byte_offset);

Increments the raw pointer by byte_offset bytes.

ByteStridedPointer& operator-=(Integer byte_offset);

Decrements the raw pointer by byte_offset bytes.

T& operator[](Integer byte_offset) const;

Returns a reference to the element starting at the specified byte_offset relative to get().

friend ptrdiff_t
operator-(ByteStridedPointer<T> a, ByteStridedPointer<U> b);

Computes the byte offset between two pointers.

friend ByteStridedPointer<T>
operator+(ByteStridedPointer<T> ptr, Integer byte_offset);
friend ByteStridedPointer<T>
operator+(Integer byte_offset, ByteStridedPointer<T> ptr);

Adds a byte offset to a pointer.

friend ByteStridedPointer<T>
operator-(ByteStridedPointer<T> ptr, Integer byte_offset);

Subtracts a byte offset from a pointer.

You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.