UDocumentation
UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
IsContiguousContainer.h
Go to the documentation of this file.
1
// Copyright Epic Games, Inc. All Rights Reserved.
2
3
#pragma once
4
5
#include "
CoreTypes.h
"
6
#include "
Misc/StaticAssertCompleteType.h
"
7
#include <initializer_list>
8
14
template
<
typename
T>
15
struct
TIsContiguousContainer
16
{
17
UE_STATIC_ASSERT_COMPLETE_TYPE
(T,
"TIsContiguousContainer instantiated with an incomplete type"
);
18
// This sizeof(T) == 0 test will let Clang treat zero-sized arrays as contiguous containers.
19
// An alternate fix using a specialization of TIsContiguousContainer (which Clang doesn't support) can be found below.
20
static
constexpr
bool
Value
=
sizeof
(T) == 0;
21
};
22
23
template
<
typename
T>
struct
TIsContiguousContainer
< T& > :
TIsContiguousContainer<T>
{};
24
template
<
typename
T>
struct
TIsContiguousContainer
< T&&> :
TIsContiguousContainer<T>
{};
25
template
<
typename
T>
struct
TIsContiguousContainer
<const T> :
TIsContiguousContainer
<T> {};
26
template
<
typename
T>
struct
TIsContiguousContainer
<
volatile
T> :
TIsContiguousContainer
<T> {};
27
template
<
typename
T>
struct
TIsContiguousContainer
<const
volatile
T> :
TIsContiguousContainer
<T> {};
28
32
template
<
typename
T,
size_t
N>
struct
TIsContiguousContainer
< T[N]> {
static
constexpr
bool
Value
=
true
; };
33
template
<
typename
T,
size_t
N>
struct
TIsContiguousContainer
<const T[N]> {
static
constexpr
bool
Value
=
true
; };
34
template
<
typename
T,
size_t
N>
struct
TIsContiguousContainer
<
volatile
T[N]> {
static
constexpr
bool
Value
=
true
; };
35
template
<
typename
T,
size_t
N>
struct
TIsContiguousContainer
<const
volatile
T[N]> {
static
constexpr
bool
Value
=
true
; };
36
40
#ifndef __clang__
41
template
<
typename
T>
struct
TIsContiguousContainer
< T[0]> {
static
constexpr
bool
Value
=
true
; };
42
template
<
typename
T>
struct
TIsContiguousContainer
<const T[0]> {
static
constexpr
bool
Value
=
true
; };
43
template
<
typename
T>
struct
TIsContiguousContainer
<
volatile
T[0]> {
static
constexpr
bool
Value
=
true
; };
44
template
<
typename
T>
struct
TIsContiguousContainer
<const
volatile
T[0]> {
static
constexpr
bool
Value
=
true
; };
45
#endif
46
50
template
<
typename
T>
struct
TIsContiguousContainer
< T[]> {
static
constexpr
bool
Value
=
false
; };
51
template
<
typename
T>
struct
TIsContiguousContainer
<const T[]> {
static
constexpr
bool
Value
=
false
; };
52
template
<
typename
T>
struct
TIsContiguousContainer
<
volatile
T[]> {
static
constexpr
bool
Value
=
false
; };
53
template
<
typename
T>
struct
TIsContiguousContainer
<const
volatile
T[]> {
static
constexpr
bool
Value
=
false
; };
54
58
template
<
typename
T>
59
struct
TIsContiguousContainer
<std::
initializer_list
<T>>
60
{
61
static
constexpr
bool
Value
=
true
;
62
};
63
64
template
<
typename
T>
65
inline
constexpr
bool
TIsContiguousContainer_V
=
TIsContiguousContainer<T>::Value
;
CoreTypes.h
StaticCastSharedRef
UE_FORCEINLINE_HINT TSharedRef< CastToType, Mode > StaticCastSharedRef(TSharedRef< CastFromType, Mode > const &InSharedRef)
Definition
SharedPointer.h:127
TIsContiguousContainer_V
constexpr bool TIsContiguousContainer_V
Definition
IsContiguousContainer.h:65
StaticAssertCompleteType.h
TIsContiguousContainer
Definition
IsContiguousContainer.h:16
TIsContiguousContainer::UE_STATIC_ASSERT_COMPLETE_TYPE
UE_STATIC_ASSERT_COMPLETE_TYPE(T, "TIsContiguousContainer instantiated with an incomplete type")
TIsContiguousContainer::Value
static constexpr bool Value
Definition
IsContiguousContainer.h:20
Engine
Source
Runtime
Core
Public
Traits
IsContiguousContainer.h
Generated by
1.9.8