Compile error when integrating with project on gcc 4.9.2 with c++11 support
littlepenny88 opened this issue · 2 comments
Hi,
I am having following compile errors while I am trying to integration my project with valijson by just including the header files.
In file included from valijson/include/valijson/schema_parser.hpp:10:0,
from test_valijson.cpp:10:
valijson/include/valijson/constraints/concrete_constraints.hpp: In member function 'virtual valijson::constraints::Constraint::OwningPointer valijson::constraints::PolyConstraint::clone(valijson::constraints::Constraint::CustomAlloc, valijson::constraints::Constraint::CustomFree) const':
valijson/include/valijson/constraints/concrete_constraints.hpp:920:16: error: cannot bind 'std::unique_ptr<valijson::constraints::Constraint, void ()(void)>' lvalue to 'std::unique_ptr<valijson::constraints::Constraint, void ()(void)>&&'
return ptr;
^
Just wonder if you would have any idea what is happening with the errors.
Thanks
Hi @littlepenny88 have you had any luck resolving this issue yet? My first suggestion would be to use a later version of gcc if possible. 4.9.2 is a very old release, and my understanding is that it is no longer supported.
One thing you could try is changing return ptr
to return OwningPtr(ptr.release());
. This could lose some exception safety, but might be good enough for your use case.
I'm going to close this issue for now, since gcc 4.9.x is no longer supported.
Feel free to re-open the issue if you think this is something that can be addressed without harming the performance or correctness of the code on more recent compiler releases.