Re: [C++-sig] wrap union types with boost.python

2022-01-16 Thread Stefan Seefeld
On 2022-01-16 12:29, Malte Dreschert wrote: Hi Stefan, thanks for answering and a greetings from northern Germany to Berlin :) the struct is meant to hold color values (three floats) but the color space can be different. It contains three of these unions and one enum value that contains the

Re: [C++-sig] wrap union types with boost.python

2022-01-16 Thread Malte Dreschert
Hi Stefan, thanks for answering and a greetings from northern Germany to Berlin :) the struct is meant to hold color values (three floats) but the color space can be different. It contains three of these unions and one enum value that contains the information which color space was used when the v

Re: [C++-sig] wrap union types with boost.python

2022-01-16 Thread Stefan Seefeld
Hi Malte, the first step is for you to decide what semantics you want `someStruct` to carry, which would then translate into an API. This is also a prerequisite for using this in pure C++, i.e. without any Python bindings. It just becomes more obvious if you want to think about accessing this

[C++-sig] wrap union types with boost.python

2022-01-16 Thread Malte Dreschert
Hello, I discovered boost.python not long ago and I really like how simple I can wrap my code. I stumbled upon the following struct and don't know how to wrap it. Help is greatly appreciated. struct someStruct { union { float a; float b; }; } Thank yo