billyquith / ponder

C++ reflection library with Lua binding, and JSON and XML serialisation.
http://billyquith.github.io/ponder/
Other
640 stars 93 forks source link

VS2015 failed to compile array properties if element type is smart pointer #41

Open ddungum opened 8 years ago

ddungum commented 8 years ago

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 !!
;
billyquith commented 8 years ago

Ok, I get the same compile error in clang on Mac. Need to tweak some of the traits.