autowrap icon indicating copy to clipboard operation
autowrap copied to clipboard

let wrapAggregate can use specific identifier

Open imzhaodong opened this issue 3 years ago • 2 comments

I'm talking about autowrap based on PyD in this case. And I suggest we enable we can specify identifier name for aggregate being wrapped.

Here is an example. We need to wrap a type which is a template.

template struct S(T)
{
  T value;
}
wrapAggregate(S!A);
wrapAggregate(S!B);

This will end with both instance in Python has same python name which is "S" and cause confliction.

I have checked the PyD implementation. PyD function wrap_class can take optional parameter PyName!"FooBar". Maybe we can dispose this to autowrap as well using optional parameters?

imzhaodong avatar Oct 27 '20 02:10 imzhaodong

The way to go would probably be using a UDA. Otherwise, manually wrapping with pyd is a workaround.

atilaneves avatar Oct 27 '20 19:10 atilaneves

Understand.

I currently manually wrapped a few class using PyD as workaround.

imzhaodong avatar Oct 28 '20 04:10 imzhaodong