v8
10.2.154 (node 18.16.0)
V8 is Google's open source JavaScript engine
Loading...
Searching...
No Matches
sentinel-pointer.h
Go to the documentation of this file.
1
// Copyright 2021 the V8 project authors. All rights reserved.
2
// Use of this source code is governed by a BSD-style license that can be
3
// found in the LICENSE file.
4
5
#ifndef INCLUDE_CPPGC_SENTINEL_POINTER_H_
6
#define INCLUDE_CPPGC_SENTINEL_POINTER_H_
7
8
#include <cstdint>
9
10
namespace
cppgc
{
11
namespace
internal {
12
13
// Special tag type used to denote some sentinel member. The semantics of the
14
// sentinel is defined by the embedder.
15
struct
SentinelPointer
{
16
template
<
typename
T>
17
operator
T*()
const
{
18
static
constexpr
intptr_t kSentinelValue = 1;
19
return
reinterpret_cast<
T*
>
(kSentinelValue);
20
}
21
// Hidden friends.
22
friend
bool
operator==
(
SentinelPointer
,
SentinelPointer
) {
return
true
; }
23
friend
bool
operator!=
(
SentinelPointer
,
SentinelPointer
) {
return
false
; }
24
};
25
26
}
// namespace internal
27
28
constexpr
internal::SentinelPointer
kSentinelPointer
;
29
30
}
// namespace cppgc
31
32
#endif
// INCLUDE_CPPGC_SENTINEL_POINTER_H_
cppgc
Definition
allocation.h:38
cppgc::kSentinelPointer
constexpr internal::SentinelPointer kSentinelPointer
Definition
sentinel-pointer.h:28
cppgc::internal::SentinelPointer
Definition
sentinel-pointer.h:15
cppgc::internal::SentinelPointer::operator==
friend bool operator==(SentinelPointer, SentinelPointer)
Definition
sentinel-pointer.h:22
cppgc::internal::SentinelPointer::operator!=
friend bool operator!=(SentinelPointer, SentinelPointer)
Definition
sentinel-pointer.h:23
include
cppgc
sentinel-pointer.h
Generated on Sat Jun 10 2023 16:59:17 for v8 by
1.9.7