Hi,
when compiling GiNaC (latest version from git master) with MSVC
(19.29.30139 for x64) it stumbles over the following code in
lst.h/lst.cpp:
lst.h line 35:
template<> registered_class_info lst::reg_info;
lst.cpp line 28:
template <> GINAC_IMPLEMENT_REGISTERED_CLASS_OPT_T(lst,
basic,
print_func<print_context>(&lst::do_print).
print_func<print_tree>(&lst::do_print_tree))
and says:
lst.cpp(28): error C2766: explicit specialization; 'reg_info' has already been defined
exprseq.h/.cpp has the same issue.
A solution seems to be to remove the code in lst.cpp and replace the code in lst.h with it. That is
lst.h:
template <> GINAC_IMPLEMENT_REGISTERED_CLASS_OPT_T(lst,
basic,
print_func<print_context>(&lst::do_print).
print_func<print_tree>(&lst::do_print_tree))
This compiles fine and all checks pass, but it does seem wrong to have the GINAC_IMPLEMENT_REGISTERED_CLASS_OPT_T in a header file.
What is the right way to deal with this error?
Thanks,
Jan Rheinländer