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

Possible bug with variadic templates and initializer list?

$
0
0

Hi,

If I try to compile

#include<initializer_list>
#include<iostream>
void foo(std::initializer_list<int> a) {
  for(auto b : a)
    std::cout << b << std::endl;
}
template<class... VALUES> 
void callFoo(VALUES... values) {
  foo({values...});
}
int main() {
  callFoo(1,2,3);
}

Intel Composer XE 2014 (on Windows) says:

error: no instance of function template "foo" matches the argument list
            argument types are: (A<double, int>)
    foo<double, int>(A<double, int>());

 

I believe this is a bug since it compiles without problems using gcc 4.8.2. and clang 3.4 on linux. Would it be possible to fix this in one of the upcoming releases?

Raffael


Viewing all articles
Browse latest Browse all 1616

Trending Articles



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