Boost logo

Boost Users :

From: Evan Carew (carew_at_[hidden])
Date: 2006-02-04 15:55:21


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Ok, am I wrong in assuming this shouldn't be happening on my linux
box? [gcc 4.0.2][boost 103200]

First the test program, then the output:

#include <iostream>
#include <cstdlib>
#include <boost/signals.hpp>

using namespace std;
using namespace boost;

class tst_out{
  public:
    void operator()() const{
      cout << "test out data1" << endl;}
      ~tst_out(){ cout << "Called del for tst_out" << endl;}
};

class tst_out2{
  public:
    void operator()() const{
      cout << "test out 2" << endl;}
      ~tst_out2(){ cout << "Called del for tst_out2" << endl;}
};

signal<void ()> sig;

int main(int argc, char *argv[])
{
  tst_out tst1;
  tst_out2 tst2;
  sig.connect(tst1);
  sig.connect(tst2);
  sig();
  cout << "exiting program" << endl;
  return EXIT_SUCCESS;
}

Now the output:

Called del for tst_out
Called del for tst_out
Called del for tst_out
Called del for tst_out
Called del for tst_out
Called del for tst_out
Called del for tst_out
Called del for tst_out2
Called del for tst_out2
Called del for tst_out2
Called del for tst_out2
Called del for tst_out2
Called del for tst_out2
Called del for tst_out2
test out data1
test out 2
exiting program
Called del for tst_out2
Called del for tst_out
Called del for tst_out
Called del for tst_out2

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.1 (GNU/Linux)

iD8DBQFD5RS4pxCQXwV2bJARAkBzAJ9mSmfH79X/IaOlmlquUMk9Ww/dAgCdH9xz
/BaVLQC9shMvnYxBPMv13DU=
=jU/r
-----END PGP SIGNATURE-----


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net