- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I'm having trouble including vectors while compiling with -std=c++11. If I try to compile
[cpp]#include <vector>
int main()
{
return 0;
}[/cpp]
using icpc -std=c++11 vector_test.cpp, I get the following error:
/opt/local/include/gcc48/c++/bits/alloc_traits.h(555): error: invalid type for defaulted assignment operator
__allow_copy_cons& operator=(__allow_copy_cons&&) = default;
It compiles fine under gcc 4.8. Is this a problem with icpc or with my library files?
Thanks
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I don't see any such problem with current icpc. Perhaps OP used a version of icpc which was too old to work with g++ 4.8.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I updated to the latest version of icpc when I encountered the problem; I'm currently using 13.0.3. The problem also exists using g++ 4.7 (both versions of gcc are installed via MacPorts, incidentally, and both just updated). If I switch to (MacPorts) g++ 4.5 or the Apple g++ 4.2, then that empty test code compiles fine, but if I try to declare a vector using an initializer list, it fails with the error
error: no instance of constructor "std::vector<_Tp, _Alloc>::vector [with _Tp=double, _Alloc=std::allocator<double>]" matches the argument list
argument types are: (double, double, double)
std::vector<double> testvec = {1.0, 2.0, 3.0};
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Like Tim, I am unable to reproduce any problems compiling with your icc version as well newwer versions. Could something be awry in your environment?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I am also unable to reproduce problems. Running icc version 13.1.3 (gcc version 4.6.3 compatibility) on Linux.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
nvm

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