Skip to content

Commit

Permalink
Merge pull request #784 from alicevision/fix/buildMSVC
Browse files Browse the repository at this point in the history
[build] fix prettyprint MSVC compatibility
  • Loading branch information
simogasp authored May 11, 2020
2 parents 0998635 + 1b6bf7d commit ff5a886
Showing 1 changed file with 18 additions and 2 deletions.
20 changes: 18 additions & 2 deletions src/aliceVision/prettyprint.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 <typename C, typename LEFT = C::const_iterator(C::*)() const>
static yes & f(typename std::enable_if<
std::is_same<decltype(static_cast<typename LEFT>(&C::begin)),
typename C::const_iterator(C::*)() const>::value>::type *);
#else // _MSCV_VER
template <typename C>
static yes & f(typename std::enable_if<
std::is_same<decltype(static_cast<typename C::const_iterator(C::*)() const>(&C::begin)),
typename C::const_iterator(C::*)() const>::value>::type *);
#endif // _MSCV_VER

template <typename C> static no & f(...);

#ifdef _MSC_VER
template <typename C, typename LEFT = C::const_iterator(C::*)() const>
static yes & g(typename std::enable_if<
std::is_same<decltype(static_cast<typename LEFT>(&C::end)),
typename C::const_iterator(C::*)() const>::value, void>::type*);
#else // _MSCV_VER
template <typename C>
static yes & g(typename std::enable_if<
std::is_same<decltype(static_cast<typename C::const_iterator(C::*)() const>(&C::end)),
typename C::const_iterator(C::*)() const>::value, void>::type*);
std::is_same<decltype(static_cast<typename C::const_iterator(C::*)() const>(&C::end)),
typename C::const_iterator(C::*)() const>::value, void>::type*);
#endif // _MSCV_VER

template <typename C> static no & g(...);

Expand Down

0 comments on commit ff5a886

Please sign in to comment.