|
Yume
|
Represents "any" kind of ast node of type T, or the absence of one. See OptionalExpr and OptionalType.
More...
#include <ast.hpp>

Public Member Functions | |
| OptionalAnyBase () | |
| OptionalAnyBase (T *raw_ptr) | |
| template<std::convertible_to< unique_ptr< T > > U> | |
| OptionalAnyBase (U uptr) | |
| OptionalAnyBase (std::nullopt_t) | |
| OptionalAnyBase (optional< unique_ptr< T > > opt_uptr) | |
| auto | operator-> () const -> const T * |
| auto | operator* () const -> const T & |
| auto | operator-> () -> T * |
| auto | operator* () -> T & |
| operator bool () const | |
| auto | has_value () const -> bool |
| auto | raw_ptr () const -> const T * |
| auto | raw_ptr () -> T * |
Represents "any" kind of ast node of type T, or the absence of one. See OptionalExpr and OptionalType.
This template exists to avoid passing around unique_ptr<T>s around in code that deals with AST nodes containing other generic nodes, such as Compound. This class has the exact same layout at AnyBase, but is nominally explicit in its semantics, in that it may be null. It replaces the earlier usages of optional<unique_ptr<T>> which in theory wastes memory for the "optional" part when a nullptr already expresses the desired semantics. Unlike AnyBase, this class does not perform null pointer checks, and may be default constructed, or constructed from a nullptr.
|
inline |
|
inlineexplicit |
|
inline |
|
inline |
|
inlineexplicit |
|
inline |
Definition at line 172 of file ast.hpp.
Referenced by yume::ast::FunctionType::describe(), yume::semantic::TypeWalker::expression(), yume::ast::GenericParam::is_type_parameter(), yume::semantic::TypeWalker::statement(), and yume::Compiler::statement().
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
Definition at line 173 of file ast.hpp.
Referenced by yume::semantic::TypeWalker::statement(), and yume::Compiler::statement().