ponder
ponder copied to clipboard
VS2015 failed to compile array properties if element type is smart pointer
I was encountered with compile errors when compiling the following code with Visual Studio 2015. Looks like it happens when a property is an array of smart pointers.
struct Element
{
};
struct Container
{
std::vector<std::shared_ptr<Element>> elements;
};
PONDER_TYPE( Element );
PONDER_TYPE( Container );
ponder::Class::declare<Element>("Element")
.constructor<>()
;
ponder::Class::declare<Container>("Container")
.constructor<>()
.property("elements", &Container::elements) // compile error !!
;
Ok, I get the same compile error in clang on Mac. Need to tweak some of the traits.