is there any way for an object to make it self no longer usable? eg

class someclass {
        string somevalue;
        bool someflag;
        int somelength;
        this (value,length,flag) {
                somevalue = value;
                someflag = flag;
                somelength = length;
        }
        void modify_value(string new_value){
                somevalue = new_value;
        }
        void finalize_data(){
                //do something with data
                //make this invalid
                // eg delete this or this = null
        }
}

I don't want to use a private flag to tell weather the object is valid or not

Reply via email to