- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
I try to compile the following code on windows, Intel Compiler XE 2014 Update 1:
[cpp]
#include<memory>
struct CompositeGrid {
template<class... GRID_IMPL>
CompositeGrid(std::shared_ptr<GRID_IMPL>... gridImpls) {
}
};
int main() {
CompositeGrid a(std::shared_ptr<int>(new int(5)));
}
[/cpp]
However this fails with the following error message:
[cpp]
parameterPackExpansion.cpp(5): error: parameter pack "GRID_IMPL" was referenced
but not expanded CompositeGrid(std::shared_ptr<GRID_IMPL>... gridImpls) {
parameterPackExpansion.cpp(5): error: pack expansion does not make use of any argument packs
CompositeGrid(std::shared_ptr<GRID_IMPL>... gridImpls) {
[/cpp]
I think this is a bug since it compiles sucessfully on gcc 4.8.2. and clang 3.4 (under linux). Weirdly enough the bug is resolved if the Constructor takes an additional, non-variadic first argument.
Cheers,
Raffael
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello Raffael,
I believe this is the same problem as described in this note:
http://software.intel.com/en-us/forums/topic/501502
Please see my reply there for a description of the bug and a suggested workaround.
Sorry for the trouble!
Judy
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Judy,
Thanks a lot, the problem that you mentioned is indeed very similar. I actually read that post before I posted mine because I was not sure that it is exactly the same. For me the difference is that in my case the constructor is a template in a usual class whereas in the case of Steffan it is a usual constructor in a class template (with variadic templates).
I just hope it will be fixed in one of the upcoming releases, util then I can emply the workaround:)
Raffael

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