On Mar 9, 12:25 pm, "receipt" <[EMAIL PROTECTED]> wrote: > [EMAIL PROTECTED] > > I wrote a very simple function, as vector<double, > __single_client_alloc> local(V.begin(), V.end());But under Gcc(g++ in fact), > version 4.0.0, I got some error as "__single_client_alloca was not declared > in this scope". I am wondering if some of you have met this before, you can > help me out here, would you? Thank you! > > 1. The whole function is : > 2 int main() > 3 { > 4 > 5 using namespace std; > 6 vector<double> V(100,5.0); > 7 vector<double, __single_client_alloc> local(V.begin(), V.end()); > 8 return 0; > 9 } > > 2. The gcc's version on my PC is : > $ gcc --version > gcc (GCC) 4.0.0 20050519 (Red Hat 4.0.0-8) > Copyright (C) 2005 Free Software Foundation, Inc. > This is free software; see the source for copying conditions. There is NO > warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. > > 3. The whole error message is : > main.c: In function int main(): > main.c:7: error: __single_client_alloca was not declared in this scope > main.c:7: error: template argument 2 is invalid > main.c:7: error: invalid type in declaration before ( token > main.c:7: error: initializer expression list treated as compound expression > main.c:7: error: cannot convert __gnu_cxx::__normal_iterator<double*, > std::vector<double, std::allocator<double> > > to int in initialization > main.c:7: warning: unused variable local > make: *** [main.o] Error 1 > > receipt > [EMAIL PROTECTED] > 2007-03-09
If __single_client_alloca was is user-defined allocator then the behaviour of this is undefined. Was it user-defined? _______________________________________________ help-gplusplus mailing list help-gplusplus@gnu.org http://lists.gnu.org/mailman/listinfo/help-gplusplus