The following simple code shows a strange behavior compiled by icpc:
#include <algorithm> #include <complex> #include <vector> struct Float { float _f; }; struct Float2 { float _f1; float _f2; }; // using objType = float; // Uncommenting this line will cause compilation to fail in line 22 (call to std::copy () in A::copyVect ()) // using objType = Float; // Same for this line // using objType = Float2; // And for thils line too using objType = std::complex<float>; // For this line compilation succeeds though it should fail as well class A { public: void copyVect (std::vector<objType> &vectSrc) const { std::copy (vectSrc.begin (), vectSrc.end (), _vect.begin ()); } public: std::vector<objType> _vect; }; int main() { return 0; }
Compilation was done using the command:
icpc-4.8 -std=c++11 stdcopy.cpp -o stdcopy
Thread Topic:
Bug Report