Skip to main content

cpp_items

Function cpp_items 

Source
pub fn cpp_items(
    ast: &Ast,
    applied: &Applied,
) -> Result<Vec<Decl>, MaterialiseError>
Expand description

Build the C++ declarations a rule application produced.

The walk is ordered_types — a post-order over the type graph, the same one the C column takes. The declaration-order problem is not C’s alone: a C++ class whose member names a class not yet defined does not compile either, and std::optional<T> and std::array<T, N> both require T complete.

§Errors

MaterialiseError when a value the output has to state does not evaluate, or a type has no C++ shape — never a silently dropped declaration.