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

Problem with initializer list

$
0
0

I've got reasons to believe (but couldn't check directly) that the following program

#include <iostream>
#include <initializer_list>

struct foo
{
  template<typename... Args>
  foo(Args&&...){std::cout<<"int ctor\n";}
  foo(std::initializer_list<int>){std::cout<<"init-list ctor\n";}
};

int main()
{
  foo x{1};
}

will output "int ctor" rather than "init-list ctor" (which is the right output) in Intel 14.01. Could some with access to the compiler check this out? Thank you!

 

Joaquín M López Muñoz

Telefónica Digital

 


Viewing all articles
Browse latest Browse all 1665

Trending Articles



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