- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Using Intel C++ Compiler v14.0 (latest as of the date on this post).
The following code:
[cpp]
template<typename uint_t, uint_t ...sig_values>
struct static_uint_array
{
static const uint_t values[sizeof...(sig_values)];
};
template<typename uint_t, uint_t ...sig_values>
const uint_t static_uint_array<uint_t,sig_values...>::values[
sizeof...(sig_values)
] = {sig_values...};
[/cpp]
...when used as...
[cpp]
uint32_t value = static_uint_array<uint32_t,0,1,2,3,4,5>::values[0];
[/cpp]
...produces this error:
*snip* expected a "}"
1> ] = {sig_values...};"
Where the caret is pointing to the ellipses.
Removing the ellipses allows the code to compile, however the element list is then expanded in reverse order (that is, "value" in the example above would be 5).
<!--break-->
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I can reproduce this problem (using the /Qstd=c++11 switch) on Windows, it works as expected with our Linux compiler.
I have submitted a defect report for this in our bug tracking database as DPD200248043. Thank you for bringing this to our attention.
Judy

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