In article <>, johny smith wrote:
> Suppose there is a policy that all objects are statically declared.
>
> For example:
>
> static Car car();
>
> Then, is there a reason to have a destructor defined for the class Car.
[-]
Sometimes.
> It would seem that perhaps there would not be a need for a destructor
> because the object would never go out of scope due to the static storage.
[-]
class static_shm_pointer {
public :
static_shm_pointer( size_t shm_size ) {
/*
** get shared memory
*/
}
~static_shm_pointer() {
/*
** remove shared memory
*/
}
};
void function() {
/*
** time consuming, so do it just once
*/
static static_shm_ptr( 1234 );
}
Cheers,
Juergen
--
\ Real name : Juergen Heinzl \ no flames /
\ Email private :
\ send money instead /
\ Photo gallery :
www.manannan.org \ /