Community
cancel
Showing results for 
Search instead for 
Did you mean: 
rnickb
Beginner
63 Views

bug with variadic template-template parameters

This code works with gcc and clang but doesn't compile with icc 2016 with std=c++14

#include <vector>                                                                
#include <iostream>                                                              
                                                                                 
template<template<class...> class Cont, class... Params>                         
auto f(const Cont<Params...>& v) {                                               
  return Cont<double>{};                                                         
}                                                                                
                                                                                 
int main() {                                                                     
  std::vector<float> v;                                                          
  auto w = f(v);                                                                 
  std::cout << std::is_same<decltype(w), std::vector<double>>::value << "\n";    
  return 0;                                                                      
}                                                

 

0 Kudos
2 Replies
olzhas_r_
New Contributor I
63 Views

I got similar failure to compile the following code (simplified version of the original code):

template <template <typename...> Sequence = std::vector>
class Adapter {
  using container_type = Sequence<int>;
};

The code compiles with GCC and Clang.
ICC states that the number of arguments for Sequence in the typedef is not enough.
ICC doesn't seem to take the default arguments into account.

olzhas_r_
New Contributor I
63 Views

This seems to be fixed with icc 17.

Reply