Skip to content

Commit

Permalink
Reordering.
Browse files Browse the repository at this point in the history
  • Loading branch information
lerno committed Mar 5, 2024
1 parent 1d2d39b commit bef019f
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/content/docs/guide/basic-types-and-values.md
Original file line number Diff line number Diff line change
Expand Up @@ -225,16 +225,16 @@ The pointer type has a special literal called `null`, which is an invalid, empty
The `void*` type is a special pointer which implicitly converts to any other pointer. It is not "a pointer to void",
but rather a wildcard pointer which matches any other pointer.

### The `typeid` type
## The `typeid` type

C3 retains some type information at runtime, in particular, each type has an identifier that uniquely
For advanced usage, C3 retains some type information at runtime, in particular, each type has an identifier that uniquely
defines it. Typicallu `Type.typeid` is used to convert a type to its unique runtime id, e.g.
`typeid a = Foo.typeid;`. The type itself is pointer-sized.

### The `any` type
## The `any` type

`any` can be seen as a typed counterpart to `void*`, it is essentially a struct a `typeid` plus a `void*` pointer
to a value. The `any` may *unsafely* be cast to any pointer.
Another type mostly for advanced usage, `any` can be seen as a typed counterpart to `void*`,
it is essentially a struct a `typeid` plus a `void*` pointer to a value. The `any` may *unsafely* be cast to any pointer.

```c3
int x;
Expand Down

0 comments on commit bef019f

Please sign in to comment.