C++ Logo


Advanced search

Additions to Metaclasses

From: David Ledger <DavidLedger_at_[hidden]>
Date: Sat, 29 Aug 2020 04:53:44 +0000

Advanced meta-programming could allow many of the different proposed features to be part of a library.
Perhaps even the overload related stuff (noexcept, &&, &, const, volatile etc...).

There are certain things that meta-classes don’t seem to even attempt.
I’m very excited about Suttons metaprogramming stuff. I’d contact him, but no idea how.

Additional things to (meta++/metaclasses/generative programming) that would have immense value:
1. Different combinations of stack state as a function execution evolves.
 allow elegant exceptions.
 allow elegant coroutines.
 allow elegant state machines (not progress only coroutines).
 allow stack in struct between stages in a function.

2. Exception sites and types.

I’m not particularly happy with C++20 coroutines, handling nested co_awaits is extremely inelegant and also appears quite inefficient. HALO optimisations seem to very rarely occur, so for my purposes, these things are virtually useless. There are hundreds of bytes allocated for even trivial code. I do see its utility however, but it just doesn’t suite my purposes☹.
Creating a coroutine by hand with structs is not so difficult in rust… but it's virtually impossible in C++ without language support.

Adding things to Clang/GCC has proved particularly irritating(to me). This could allow people to implement features in multiple compilers using the same source.
Cross compiler feature support sounds epic.

I’m also very impressed by rust's enums, while their name is slightly od (not only a number). I think there is serious utility for such an elegant tagged union.

    David Ledger

Received on 2020-08-28 23:57:13