7

IntelliSense in the Visual Studio 2017 (15.1) underlines the word Type in the following code:

#include <type_traits>

template<class... Vars>
struct Test : std::true_type { };

template<class... TT>
using Type /*!*/ = std::conditional_t<std::conjunction_v<Test<TT>...>, int, double>;

//template<class... TT>
//using Type = std::conditional_t<std::conjunction<Test<TT>...>::value, int, double>; // no error

int main()
{
    return 0;
}

The error reads (with some obvious omissions): alias template type "std::conditional_t<...>" is incompatible with the previous type of "std::conditional_t<...>" in the redeclaration of alias template "Type".

The code compiles. Is it a bug in IntelliSense?

Evg
  • 25,259
  • 5
  • 41
  • 83

0 Answers0