Your name is ever so appropriate. You are truly a master of non-sequiturs.
@amanaysin:
The problem is that the visitor object you pass to depth_first_search is repeatedly copied by the function. You cannot store state in the visitor object self. To solve your problem, you will need to make the data members of the object references to 'external' (ie, outside the class instance) variables.
Actually, without looking at the declaration and implementation of depth_first_search, my guess is that the visitor object is being copied onto the stack (passed by value) to the function. Anyway, what I said above still applies.