Quantcast
Channel: Intel® Software - Intel® C++ Compiler
Viewing all articles
Browse latest Browse all 1175

Intel 16.0.4 compiler error for std::enable_if

$
0
0

Hi,

   template <typename T, decltype(T::a)* = nullptr>
   bool DoCheck1(T t) { return false; }

   template <typename T, decltype(T::b)* = nullptr>
   bool DoCheck1(T t) { return false; }

   template <typename T, typename std::enable_if<true, decltype(T::a)>* = nullptr>
   bool DoCheck2(T t) { return false; }

   template <typename T, typename std::enable_if<true, decltype(T::b)>* = nullptr>
   bool DoCheck2(T t) { return false; }

Both above versions should have same behaviour, but icc 16.0.4 on Linux gives the following compilation error for DoCheck2 -

error: redefinition of default argument
     template <typename T, typename std::enable_if<true, decltype(T::b)>* = nullptr>

Is this expected behaviour or a bug?

Regards,

Tarun


Viewing all articles
Browse latest Browse all 1175

Trending Articles



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