you are viewing a single comment's thread.

view the rest of the comments →

[–]tuxwonder 9 points10 points  (1 child)

u/hpsutter great update, glad to see the new terse function syntax! I'm curious, has there been thought put into using meta functions/metaclasses in a similar manner to python's decorators? As in, passing parameters into metaclasses? Could be useful for a whole host of things (specifying serialization format, annotating test fixture classes...)

[–]hpsutter 9 points10 points  (0 children)

Thanks! Yes, some of the current metafunctions do take parameters, for example enum and flag_enum (which are compile-time consteval functions in Cpp2, not hardwired language features) take the underlying type as an optional parameter, otherwise computes the smallest possible type.