853c17a966
- Use backticks to create cross-refs (https://chromium.googlesource.com/chromium/src/+/master/styleguide/c++/c++-dos-and-donts.md#comment-style) - More API docs Change-Id: Ia90641a532aa84c51bbf4cf96d9ab1c6c1505de5 Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2484403 Reviewed-by: Omer Katz <omerkatz@chromium.org> Commit-Queue: Michael Lippautz <mlippautz@chromium.org> Cr-Commit-Position: refs/heads/master@{#70602}
26 lines
646 B
C++
26 lines
646 B
C++
// Copyright 2020 the V8 project authors. All rights reserved.
|
|
// Use of this source code is governed by a BSD-style license that can be
|
|
// found in the LICENSE file.
|
|
|
|
#ifndef INCLUDE_CPPGC_EPHEMERON_PAIR_H_
|
|
#define INCLUDE_CPPGC_EPHEMERON_PAIR_H_
|
|
|
|
#include "cppgc/member.h"
|
|
|
|
namespace cppgc {
|
|
|
|
/**
|
|
* An ephemeron pair is used to conditionally retain an object.
|
|
* The `value` will be kept alive only if the `key` is alive.
|
|
*/
|
|
template <typename K, typename V>
|
|
struct EphemeronPair {
|
|
EphemeronPair(K* k, V* v) : key(k), value(v) {}
|
|
WeakMember<K> key;
|
|
Member<V> value;
|
|
};
|
|
|
|
} // namespace cppgc
|
|
|
|
#endif // INCLUDE_CPPGC_EPHEMERON_PAIR_H_
|