- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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; }
Link Copied
2 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
This seems to be fixed with icc 17.

Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page