- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
The following snippet should compile, it does not compile => sad face.
template<typename... Args> struct S { void f(Args... args); // This declaration of f is fudging it up. //auto f(Args... args) -> void; // This declaration on the other hand works. }; template<typename... Args> inline auto S<Args...>::f(Args... args) -> void { f(args...); } int main() { S<int> s; s.f(0); return 0; }
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
What version of the compiler are you using (do an icc -v)?
I think this was fixed back in January by this fix:
1/15/16
Redeclarations of variadic function templates
When a variadic function template is redeclared using a form that is slightly
different from the original declaration, the front end sometimes corrupted the
type of the function template, causing the variadic nature of parameters to
be lost and incorrect deduction behavior later on. For example:
template<typename ... Ts> void f(Ts&&...);
template<typename ... Ts> auto f(Ts&&...)->void {}
void g() {
f(1, 2); // Previously triggered a spurious error. Now okay.
}
This is now fixed.
If you are using an older compiler, please get the latest 16.0 update.
sorry for the trouble.
Judy
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page