Quantcast
Channel: Intel® C++ Compiler
Viewing all articles
Browse latest Browse all 1616

template substitution bug with default template arguments

$
0
0

The following code compiles fine with gcc and clang but gives an error with icc 2016.

#include <utility>

struct A {
  using value_type = double;
};

struct K {
  template<class T, class V = typename T::value_type>
  auto require(T&& x) -> std::true_type;
};

template<
    class X , class Y,
    typename R = decltype(std::declval<X>().template require<Y>(
        std::declval<Y>()))>
constexpr bool g() {
  return R::value;
}

int main() {
  g<K, A>();
  return 0;
} 

 


Viewing all articles
Browse latest Browse all 1616

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>