can destructors take parameters?

could you write:
1
2
3
4
5
6
7
8
9
10
11
12
class foo
{
  foo()
  {
    //code
  }

  ~foo(int bar)
  {
    //code
  }
}
No, You can not. If you do want to customize the dtor (deleter), i.e., close database connection when calling the dtor, use boost::shared_ptr.
what is boost::shared_ptr?
It is a C++ library to be used in the coming 0x C++ standard.
http://www.boost.org/
Topic archived. No new replies allowed.