Skip to content
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

The "C++ API" tab presents the wrong syntax for optional entries (missing pointer) #35

Open
Gaspard-- opened this issue Aug 21, 2024 · 1 comment

Comments

@Gaspard--
Copy link

Gaspard-- commented Aug 21, 2024

When going on the queries page, and using a query like:

?Offset($this)

And then looking at the C++ API tag, the suggested code looks like the following:

Declaration:

flecs::query<Offset> q;

Creation:

q = world.query_builder<Offset>()
  .term_at(0).optional()
  .build();

Iteration

q.each([](flecs::entity e, Offset&) {

});

In all of the C++ code above, offset should be a pointer Offset *.

@SanderMertens
Copy link
Member

Nice catch! I'll look into it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants