Skip to content

Document macro versions of sizeof and alignof #823

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions docs/syntax_and_semantics/alignof.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,3 +38,5 @@ The argument to alignof is a [type](type_grammar.md) and is often combined with
a = 1
alignof(typeof(a)) # => 4
```

`sizeof` can be used in the macro language, but only on types with stable size and alignment. See the API docs of [`alignof`](https://crystal-lang.org/api/Crystal/Macros.html#alignof(type):NumberLiteral-instance-method) for details.
2 changes: 2 additions & 0 deletions docs/syntax_and_semantics/sizeof.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,5 @@ The argument to sizeof is a [type](type_grammar.md) and is often combined with [
a = 1
sizeof(typeof(a)) # => 4
```

`sizeof` can be used in the macro language, but only on types with stable size and alignment. See the API docs of [`sizeof`](https://crystal-lang.org/api/Crystal/Macros.html#sizeof(type):NumberLiteral-instance-method) for details.