-
Notifications
You must be signed in to change notification settings - Fork 16
Description
Issue from revbayes/revbayes#837 (comment) by @bredelings:
It looks like NCL has a few problems with C++20. I wonder if the upstream NCL fixes these.
(Hmm... it seems like it doesn't? So I guess this isn't really related to the current PR, so maybe I should move this comment to its own issue)
The issue seems to be that
nxscharactersblock.hdoesclass NxsDiscreteDatatypeMapper; class NxsCharactersBlock { ... typedef std::pair<NxsDiscreteDatatypeMapper, NxsUnsignedSet> DatatypeMapperAndIndexSet; typedef std::vector<DatatypeMapperAndIndexSet> VecDatatypeMapperAndIndexSet; ... }; class NxsDiscreteDatatypeMapper { ... NxsDiscreteDatatypeMapper(NxsCharactersBlock::DataTypesEnum datatypeE, bool hasGaps); ... };The error is because the definition for
NxsDiscreteDatatypeMapperis not known whenstd::pair<NxsDiscreteDatatypeMapper, NxsUnsignedSet>is first used. This was allowed in C++17 in some circumstances, but is not longer allowed in C++20.We could simply move the definition of NxsDiscreteDatatypeMapper above the definition of NxsCharactersBlock, except that NxsDiscreteDatatypeMapper also references NxsCharactersBlock through NxsCharactersBlock::DataTypesEnum, creating a reference loop.