From 1b6bf7d5f98121cc39cdd74618b3af24023f582b Mon Sep 17 00:00:00 2001 From: Yann Lanthony Date: Fri, 22 Nov 2019 15:29:22 +0100 Subject: [PATCH] [build] fix prettyprint MSVC compatibility fix build issues with MSVC 2017, from: https://github.com/jgehring/cxx-prettyprint/commit/4186b8fff23b3f897021999cb67f086a2e14236a --- src/aliceVision/prettyprint.hpp | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/src/aliceVision/prettyprint.hpp b/src/aliceVision/prettyprint.hpp index 557be4773f..ca6225e0e2 100644 --- a/src/aliceVision/prettyprint.hpp +++ b/src/aliceVision/prettyprint.hpp @@ -49,17 +49,33 @@ namespace pretty_print struct has_begin_end : private sfinae_base { private: +#ifdef _MSC_VER + // Work around MSVC ICE in 15.9.x by moving decltype out to template + // typename + template + static yes & f(typename std::enable_if< + std::is_same(&C::begin)), + typename C::const_iterator(C::*)() const>::value>::type *); +#else // _MSCV_VER template static yes & f(typename std::enable_if< std::is_same(&C::begin)), typename C::const_iterator(C::*)() const>::value>::type *); +#endif // _MSCV_VER template static no & f(...); +#ifdef _MSC_VER + template + static yes & g(typename std::enable_if< + std::is_same(&C::end)), + typename C::const_iterator(C::*)() const>::value, void>::type*); +#else // _MSCV_VER template static yes & g(typename std::enable_if< - std::is_same(&C::end)), - typename C::const_iterator(C::*)() const>::value, void>::type*); + std::is_same(&C::end)), + typename C::const_iterator(C::*)() const>::value, void>::type*); +#endif // _MSCV_VER template static no & g(...);