calebh / Juniper

https://www.juniper-lang.org/
MIT License
79 stars 9 forks source link

Algebraic data type with pointer member causes C++ compilation error #4

Closed calebh closed 3 years ago

calebh commented 4 years ago

Smart pointers cannot be members of unions due to smart pointers having non-trivial copy constructors. Obviously there is no reason for this restriction to exist since all of the algebraic data types are tagged. Consider moving from unions to something more like std::variant or boost::variant to allow this use case.

calebh commented 3 years ago

A custom variant implementation equivalent to std::variant has been implemented, which fixes this issue.