Re: trouble with valarray and gcc 3.3
Re: trouble with valarray and gcc 3.3
- Subject: Re: trouble with valarray and gcc 3.3
- From: Joseph Kim <email@hidden>
- Date: Thu, 9 Sep 2004 21:58:35 -0500
On Sep 9, 2004, at 9:17 PM, Doug McCoy wrote:
-----start----
#include <valarray>
std::valarray<int> v1; // construct an empty valarray
std::valarray<int> v2(1,3); // construct a valarray of three
// elements, all initialized to 1
v1.resize(3,2); // resize the first valarray to three
^^^^^^^^^^^^^^^^
// elements, all initialized to 2
std::valarray<int> v3(v1); // v3 gets a copy of v1's elements.
-----end-----
All other lines are fine as global variable
declarations/initializations.
The offending line doesn't belong at this scope.
I.e.:
#include <valarray>
int main()
{
// ... insert your code here.
// ... the offending line is fine as a statement within a function.
return 0;
}
Not an issue with Darwin GCC.
As an aside, I always use "c++" rather than "gcc" to drive the linker
to make
sure all the correct libraries and object files are brought in if at
least
one of the source files is a C++ source file (too lazy to try to supply
all the
right linker input manually :)
10Q.
Joe
_______________________________________________
darwin-development mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/darwin-development
Do not post admin requests to the list. They will be ignored.