Re: (Boost) Reflecto

Emil Dotchevski via Boost <[email protected]>
Newsgroups gmane.comp.lib.boost.devel
Message-ID <CAN5fK5H9dEMURYLAq+vyzpSCArna-FFGMJN0D2TsJ3yBf94BcA@mail.gmail.com>
On Mon, Apr 6, 2026 at 6:42 AM Andrey Semashev via Boost <
[email protected]> wrote:

> On 4 Apr 2026 21:47, Emil Dotchevski via Boost wrote:
> > I wrote a small constexpr type/enum reflection library which I think may
> be
> > a good addition to Boost. It needs C++17, although it relies on
> > implementation-specific support (works on gcc, clang and msvc).
> >
> > https://github.com/zajo/reflecto
>
> Why are the enum_lookup_range limits necessary? As far as I could tell
> from my brief glance at the code, you simply cut the enum value names
> from function signature strings, no actual lookup is involved, so why
> the limits?
>

- enum_value_name() can be invoked with a variable at run-time. This is
implemented in terms of indexing a constexpr array constructed over the
lookup range at compile time. If the value is out of the lookup range,
that's indicated in the state of the returned name object.

- enum_value_names<E> returns a constexpr array of name/value pairs (like
Describe does for described enums) that includes only the named values;
there is also named_enum_value_count and min_/max_named_enum_value.
_______________________________________________
Boost mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://lists.boost.org/mailman3/lists/boost.lists.boost.org/
Archived at: https://lists.boost.org/archives/list/[email protected]/message/N5PQD7MLENT3LA3RYNRCBLVU2J5WJBSQ/
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.