Skip to content

Prepare release 0.5.0 - #31

Merged
Yaraslaut merged 6 commits into
masterfrom
release/0.5.0
Oct 1, 2026
Merged

Yaraslaut merged 6 commits into
masterfrom
release/0.5.0

Conversation

@Yaraslaut

@Yaraslaut Yaraslaut commented Oct 1, 2026 •

Copy link
Copy Markdown
Member

Collects what was left open before the next release: one feature, documentation, and the version bump.

Changes

  • Types in anonymous namespaces and at function scope are supported with GCC and Clang. Member names are read from the address of a member of an object that only has to exist at compile time. That object was a variable declared extern and never defined, which compilers reject for types without external linkage. On GCC and Clang it is now a union holding the object as a member that is never constructed: a real definition, which still does not require the type to be constructible. MSVC accepts neither technique for such types, so it keeps the previous behaviour; the README states the limitation. Addresses Add support for structs in anonymous namespaces and function scope #26 for GCC and Clang.
  • The public API is documented: a usage section in the README, whose examples are compiled and run, and a description on every public declaration. The descriptions of EnumerateMembers wrongly said the callable receives a default-constructed value. Closes document public API in comments #6.
  • The note about an MSVC linker error in the workflow is removed, since those jobs pass.
  • The version is bumped to 0.5.0.

Notes for the release

Since 0.4.0, three changes can require adjustments in user code:

  • FoldMembers passes the accumulator to the callable as an rvalue. A callable taking it as a non-const lvalue reference no longer compiles.
  • CallOnMembersWithoutName passes the plain member type as template argument, not a reference type.
  • Inspect prints enum members by their numeric value.

MaxReflectionMemerCount was renamed to MaxReflectionMemberCount in #28; the old name remains as a deprecated alias.

🤖 Generated with Claude Code

https://claude.ai/code/session_01Ar6Ahymw9LhLsnM324z5cV

Yaraslaut and others added 6 commits October 1, 2026 19:42
The MSVC jobs build, link and pass the tests.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Ar6Ahymw9LhLsnM324z5cV
Signed-off-by: Yaraslau Tamashevich <yaraslau.tamashevich@gmail.com>
Member names are read from the address of a member of an object that only
needs to exist at compile time. That object was a variable declared
`extern` and never defined, which compilers reject for types without
external linkage, since no other translation unit could define it.

Use a union holding the object as a member that is never constructed
instead. It is a real definition, so it works for every type, and still
does not require the type to be constructible.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Ar6Ahymw9LhLsnM324z5cV
Signed-off-by: Yaraslau Tamashevich <yaraslau.tamashevich@gmail.com>
MSVC does not accept the address of a member of a union member that was
never constructed as a constant expression, so it keeps using the object
that is declared but never defined.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Ar6Ahymw9LhLsnM324z5cV
Signed-off-by: Yaraslau Tamashevich <yaraslau.tamashevich@gmail.com>
Add a usage section to the README, and a description to every public
declaration that had none. The descriptions of EnumerateMembers claimed
the callable receives a default-constructed value, while it receives a
reference to the member.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Ar6Ahymw9LhLsnM324z5cV
Signed-off-by: Yaraslau Tamashevich <yaraslau.tamashevich@gmail.com>
MSVC rejects the declared-only stand-in object for types without external
linkage (C7631), and does not accept the union used by the other compilers
either. Member names of types in anonymous namespaces or at function scope
therefore remain unavailable with MSVC. Say so in the README and next to
the code, and skip the tests for it there.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Ar6Ahymw9LhLsnM324z5cV
Signed-off-by: Yaraslau Tamashevich <yaraslau.tamashevich@gmail.com>
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Ar6Ahymw9LhLsnM324z5cV
Signed-off-by: Yaraslau Tamashevich <yaraslau.tamashevich@gmail.com>
@Yaraslaut
Yaraslaut merged commit 7c6dd27 into master Oct 1, 2026
33 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.

document public API in comments

1 participant