This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: is g++ 3.1 too slow?


Reza Roboubi wrote:
> simple enough.  I put it on my  web site:
> 
> http://www.linisoft.com/test/test.ops.cc

Ah well, all this goes on the archive, so the right thing might be to
copy test.ops.cc here:


test.ops.cc
============
#include <stdio.h>

int j=10;

class o
{
	public:
	int i;
	o(int ii)
	{
		i=ii;
	}
	o(const o &oo)
	{
		i=oo.i;
	}
	o operator +(o oo)
	{
		return o(i+oo.i+(j+=10));
	}
};

int main()
{
		o(1)+o(2)+o(3);
		o(1)+o(2)+o(3);
		o(1)+o(2)+o(3);
		... //same line must repeat about 440 times
		return 0;
}


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]