Justin Davis

Results 81 comments of Justin Davis

I would also be curious as to how this PR relates to #8565

there is a c++17 support flag for flatc c++ generation that this feature could be added to. I've pulled the relevant generated functions from the Monster fbs file for disussion:...

> My main beef would be its inefficiency sure. I think the intent with providing a variant is to provide a "flatbuffers canonical" method of going from the (seemingly internal)...

alrighty - I'm getting close(ish) to having a branch up for this. I still need to see why the mutable union functions aren't generated, and need to write tests/docs. Here...

this code does make the assumption of a correctly formed flatbuffer -- if you have a type but no value this will try to create a reference of a nullptr.

I've been doing a bit of digging on this and I think it may be valuable to also support generating first class enum types over object types -- see #5083...

> What would be the use-cases enabled by this? The only thing i see is the Enum name to string eg. Enum.A.name -> 'A' but i personally don't even see...

I should rephrase, the use case I need is to be able to do something like ```python def print_value(val: int) -> None: print(f"{MyEnum(val).name}") ``` and also the opposite can be...

Funny note - I instrumented this in my code base to play with, and the only thing it broke were my own custom to and from string functions. Haha

@vaind poking you for awareness on this topic :)