- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Intel C++ Compiler (EDG-based frontend) rejects the following code:
template <typename Descriptor> class hash_table { public: typedef int value_type; template <typename Argument, int Callback (value_type *, Argument)> void traverse (Argument); }; template <typename Descriptor> template <typename Argument, int Callback (typename hash_table <Descriptor>::value_type *, Argument)> void hash_table <Descriptor>::traverse (Argument) {}
with the following error message:
$ /opt/intel/bin/icpc -v icpc version 16.0.0 (gcc version 4.9.0 compatibility) $ /opt/intel/bin/icpc -c test.cc test.cc(13): error: declaration is incompatible with function template "void hash_table<Descriptor>::traverse<Argument,Callback>(Argument)" (declared at line 8) void hash_table <Descriptor>::traverse (Argument) {} ^ compilation aborted for test.cc (code 2)
Both GCC 4.9.x and later and Clang 3.7 accept this code. See also: question on Stack Overflow.
Link Copied
2 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Mikhail,
I've escalated this issue to our engineering team. Thank you for your small test case.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Mikhail,
This issue has been fixed in the latest 16.0 compiler update. FYI.

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