boost::variant: Wrapping C-struct inside C++ class

Hi there, Did anyone write up a small C++ wrapper class when one want to use C-struct as part of boost::variant. When using C-struct boost::variant fails with: /usr/include/boost/variant/variant.hpp:294: error: request for member ‘~__mpfr_struct [1]’ in ‘operand’, which is of non-class type ‘__mpfr_struct [1]’ make[2]: *** [CMakeFiles/variant_mpfr.dir/variant_mpfr.cxx.o] Error 1 Thanks ! -- Mathieu

AMDG Mathieu Malaterre wrote:
Did anyone write up a small C++ wrapper class when one want to use C-struct as part of boost::variant. When using C-struct boost::variant fails with:
/usr/include/boost/variant/variant.hpp:294: error: request for member ‘~__mpfr_struct [1]’ in ‘operand’, which is of non-class type ‘__mpfr_struct [1]’ make[2]: *** [CMakeFiles/variant_mpfr.dir/variant_mpfr.cxx.o] Error 1
The problem isn't that it's a struct. structs should work fine, since there is no fundamental difference between a struct and a class. The problem is that it's an array. In Christ, Steven Watanabe
participants (2)
-
Mathieu Malaterre
-
Steven Watanabe