From 0db79eb15b2f1dda1dd07a807b98086698cfee7a Mon Sep 17 00:00:00 2001 From: StefanBruens Date: Wed, 7 Dec 2022 05:06:41 +0100 Subject: [PATCH] Avoid ambigous definition of mmtf's is_polymer MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit `is_polymer` can be found with ADL lookup in the `mmtf` namespace (due to `mmtf::Entity`) and via ordinary lookup in the enclosing namespace, making it ambigous. Remove the copied definition is mmtf is recent enough. Fixes #1185. Signed-off-by: Stefan BrĂ¼ns --- avogadro/io/mmtfformat.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/avogadro/io/mmtfformat.cpp b/avogadro/io/mmtfformat.cpp index 1fcaeef70..4d90a72b2 100644 --- a/avogadro/io/mmtfformat.cpp +++ b/avogadro/io/mmtfformat.cpp @@ -35,8 +35,10 @@ MMTFFormat::MMTFFormat() = default; MMTFFormat::~MMTFFormat() = default; +namespace { // from latest MMTF code, under the MIT license // https://github.com/rcsb/mmtf-cpp/blob/master/include/mmtf/structure_data.hpp +#if MMTF_SPEC_VERSION_MAJOR <= 1 && MMTF_SPEC_VERSION_MINOR < 1 bool is_polymer(const unsigned int chain_index, const std::vector& entity_list) { @@ -50,6 +52,8 @@ bool is_polymer(const unsigned int chain_index, } return false; } +#endif +} // namespace bool MMTFFormat::read(std::istream& file, Molecule& molecule) {