- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
The following code compiles and runs properly with gcc 8.2.0 (using -std=c++17). It also compiles with icc 19.0.1.144, but throws a 'Floating point exception' when trying to access 'map' in the constructor. #include <iostream> #include <unordered_map> struct A { static inline std::unordered_map<int, int> map; A(){ map[1] = 2; } }; int main(){ A a; }
A similar code with a primitive or 'std::vector' in place of 'std::unordered_map' does appears to work.
Am I missing something or is this a problem with the compiler?
This question was first posted here
- Tags:
- CC++
- Development Tools
- Intel® C++ Compiler
- Intel® Parallel Studio XE
- Intel® System Studio
- Optimization
- Parallel Computing
- Vectorization
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I've reported this problem to our Developer. An internal case is #CMPLRIL0-31151
Thanks,
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
Where can I find out if this issue was handled in newer icc versions?
Should the internal case number appear anywhere?
Apologies. I'm new to these things...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
What is the purpose of the use of inline on an object?
Is this to possibly attribute inline to all the member functions?
The place for this would be inside the template(s).
Jim Dempsey
EDIT: Nevermind, I see: https://www.codingame.com/playgrounds/2205/7-features-of-c17-that-will-simplify-your-code/inline-variables
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page