1 /* Distributed under the OSI-approved BSD 3-Clause License. See accompanying
2 file Copyright.txt or https://cmake.org/licensing for details. */
5 #include "cmConfigure.h" // IWYU pragma: keep
9 /** Base class template for CRTP to represent a stack of constant values.
10 Provide value semantics, but use efficient reference-counting underneath
12 template <typename T
, typename Stack
>
16 std::shared_ptr
<Entry
const> TopEntry
;
19 /** Default-construct an empty stack. */
22 /** Get a stack with the given call context added to the top. */
23 Stack
Push(T value
) const;
25 /** Get a stack with the top level removed.
26 May not be called until after a matching Push. */
29 /** Get the value at the top of the stack.
30 This may be called only if Empty() would return false. */
33 /** Return true if this stack is empty. */
37 cmConstStack(std::shared_ptr
<Entry
const> parent
, T value
);
38 cmConstStack(std::shared_ptr
<Entry
const> top
);