lifetime of temporaries

2007-07-04 Thread sebastien333
I have the following program: class A { string s; public: A(const string& a) : s(a) { cout << s << endl; } }; class B : public A { public: B(const string& b) : A(b) { } }; class C : public B { public: C() : B(string("ABC")) { } }; int main(int argc, char *argv) { unsigned char

Re: Vectorization in gcc 4.1.1

2007-07-04 Thread BobR
rameshk <[EMAIL PROTECTED]> wrote in message... > Hi, > I was trying to get gcc to vectorize a simple loop: > > #include // > int test(double *x , int size); > > int test(double *x, int size){ > int ret = 1; > std::vector v; > v.resize(size); > double *a = &v[

Difficulty: Wrap hash set and hash set iterators

2007-07-04 Thread benjamin . bihler
Hi, I have written a class that wraps __gnu_cxx::hash_set's. It works fine now (thanks for your help!). It is implemented with templates so that I can use it for different storage types. I would like to use an iterator over the hash set. But that is quite complicated. The STL-Iterator of my hash

Re: lifetime of temporaries

2007-07-04 Thread Maxim Yegorushkin
On 4 Jul, 16:55, [EMAIL PROTECTED] wrote: > I have the following program: > > class A > { > string s; > > public: > A(const string& a) : s(a) { cout << s << endl; } > > }; > > class B : public A > { > public: > B(const string& b) : A(b) { } > > }; > > class C : public B > { > public: >

Re: Vectorization in gcc 4.1.1

2007-07-04 Thread Lionel B
On Mon, 02 Jul 2007 14:27:11 -0700, rameshk wrote: > Hi, > > I was trying to get gcc to vectorize a simple loop: > > #include > > int test(double *x , int size); Don't know what this is for. > int test(double *x, int size) > { > > int ret = 1; > std::vector v; >