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
  • C span
  • C Utf8String
  • C SmallBitSet
  • C MaybeHardConstraintSpan
  • C MaybeHardConstraintIndex
  • V IsCompatibleOptionSequence
  • E CastChecking
  • C unchecked_t
  • V IsStaticCastConstructible

This view

  • Original page
  • New address

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

#include "tensorstore/data_type.h"
template <typename TargetElement,
          CastChecking Checking = CastChecking::checked,
          typename SourceRef>
StaticCastResultType<RebindDataType<SourceRef, TargetElement>,
                     SourceRef,
                     Checking>
tensorstore::StaticDataTypeCast(SourceRef&& source);

Casts source to have a static data type of TargetElement.

The source type must be supported by RebindDataType and define a nested Element type, and both the source and target types must be supported by StaticCast.

The semantics of the Checking parameter are the same as for StaticCast.

This cast cannot be used to cast away const qualification of the source element type. To do that, use ConstDataTypeCast instead.

Examples:

Array<void> array = ...;
Result<Array<int>> result = StaticDataTypeCast<int>(array);
Result<Array<const int>> result2 = StaticDataTypeCast<const int>(array);
Array<const int> unchecked_result =
    StaticDataTypeCast<const int, unchecked>(array);

DataType d = ...;
Result<dtype_t<int>> d_static = StaticDataTypeCast<int>(d);

dtype_t<int> d_int;
DataType d_dynamic = StaticDataTypeCast<void>(d_int);
Template Parameters:¶
typename TargetElement¶

Target element type. Depending on the source type, const-qualified TargetElement types may or may not be supported.

CastChecking Checking = CastChecking::checked¶

Specifies whether the cast is checked or unchecked.

Parameters:¶
SourceRef &&source¶

Source value.

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.