This is the mail archive of the libstdc++@gcc.gnu.org mailing list for the libstdc++ 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: [libstdc++ PATCH] tr1::mem_fn and tr1::function, take 2


well...

I have a comment. Any chance you can put some of this infrastructure

int truncate_float(float x) { return (int)x; }
long truncate_double(double x) { return (long)x; }

struct do_truncate_float_t
{
 do_truncate_float_t()
 {
   ++live_objects;
 }

 do_truncate_float_t(const do_truncate_float_t&)
 {
   ++live_objects;
 }

 ~do_truncate_float_t()
 {
   --live_objects;
 }

int operator()(float x) { return (int)x; }

 static int live_objects;
};

int do_truncate_float_t::live_objects = 0;

struct do_truncate_double_t
{
 do_truncate_double_t()
 {
   ++live_objects;
 }

 do_truncate_double_t(const do_truncate_double_t&)
 {
   ++live_objects;
 }

 ~do_truncate_double_t()
 {
   --live_objects;
 }

long operator()(double x) { return (long)x; }

 static int live_objects;
};

int do_truncate_double_t::live_objects = 0;

struct X
{
 int bar;

 int foo()                   { return 1; }
 int foo_c() const           { return 2; }
 int foo_v()  volatile       { return 3; }
 int foo_cv() const volatile { return 4; }
};



inside testsuite_tr1.h and then avoid

{
test01();
test02();
test03();
test04();
test05();
test06();
test07();
test08();
test09();


so many tests in a single file?!? Usually, for various reasons, we don't
do that (i.e., in case of failures/regressions, you can see immediately
which specific feature is at issue).

Also, please add attribute unused to the bool test (see the beginning
of testsuite_hooks.h to understand why we are keeping this, for now
at least)

Paolo.


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