C++ Logo

sg7

Advanced search

Re: Update: P1240R2 — Scalable Reflection

From: Jonathan O'Connor <jonathan.oconnor_at_[hidden]>
Date: Sun, 30 Jan 2022 12:55:26 +0000
Hi,

Here are some remarks on code generation and extending the splicing operator. I presume both are out of scope for the paper.

## Generating classes
In the future, I would like to be able to define classes and functions, based on some `std::meta::info`.
As processing of an `info` has to happen inside a function, so it needs to look like the following:

```c++
template<typename T>
auto makeClass() {
    // some magic here to define a class based on T.
    return GeneratedClass{};
}

template<typename T>
using generatedClass = decltype(makeClass<T>());
```

C++ could support AOP (Aspect Oriented Programming) if we could do this.
I presume this is out of scope for R1240.

## Splicing operator

Has any thought gone into extending what the splicing construct can do? Could it be
extended to allow creation of new symbols? If the splicing construct only takes
a reflection, then that restricts its utility.


Regards,
Jonathan

‐‐‐‐‐‐‐ Original Message ‐‐‐‐‐‐‐

On Saturday, January 15th, 2022 at 17:41, Daveed Vandevoorde via SG7 <sg7_at_[hidden]> wrote:

> SG7 mailing list
>
> SG7_at_[hidden]
>
> https://lists.isocpp.org/mailman/listinfo.cgi/sg7

Received on 2022-01-30 12:55:28