Skip to content

Conversation

elbeno
Copy link
Contributor

@elbeno elbeno commented Oct 6, 2025

Problem:

  • Messages support get and set but not a natural indexing syntax.

Solution:

  • Add operator[] to message, so that the follow work:
msg["a"_field] = 42;
auto x = msg["a"_field];

Problem:
- When a field is not in a message, trying to access it can give an help
  message from inside `stdx::tuple` instead of a nicer message.

Solution:
- Give a nicer help message when trying to access a named field that isn't in a
  message.
@elbeno elbeno enabled auto-merge October 6, 2025 16:48
@elbeno elbeno force-pushed the msg-indexing branch 3 times, most recently from 024f806 to e101a1a Compare October 6, 2025 17:31
Problem:
- Messages support `get` and `set` but not a natural indexing syntax.

Solution:
- Add `operator[]` to message, so that the follow work:

```c+++
msg["a"_field] = 42;
auto x = msg["a"_field];
```
@elbeno elbeno merged commit 417ee86 into intel:main Oct 6, 2025
29 checks passed
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

Successfully merging this pull request may close these issues.

2 participants