C++ Logo

sg7

Advanced search

Re: CppMeta code reflection and C code reflection

From: Jens Maurer <jens.maurer_at_[hidden]>
Date: Fri, 23 Feb 2024 19:19:04 +0100
On 23/02/2024 17.08, Robin Rowe via SG7 wrote:
> << I think all reflection proposals show how to implement enum to
> string.The CppMeta version seems more complicated than the P2996
> proposal, but I think that was only because they wanted to show off
> lower level code generation capabilities. >>
>
> Yes, enum_to_string is in P2996. Uses templates to implement, which we
> don't have in C. Any proposals or ideas suggested for reflection that
> can do enum_to_string yet don't involve templates? Any approach more
> minimalist than P2996 or CppMeta?

I'm slightly confused. This is a reflector for a subgroup of WG21,
the ISO standardization committee for C++.

You seem to be asking about a facility suitable for C.
The ISO standardization committee for C is WG14.
I'd suggest to talk to them to get an opinion.
If all you want is an "enum_to_string" facility, maybe they are
interested in a specific proposal (with very specific syntax)
that delivers that.

From a C++ viewpoint, P2996 seems to deliver that feature in
a nice generic framework, so I'm not seeing an open issue.

Jens

Received on 2024-02-23 18:19:11