oh no no not that problem i havent used comments in code actually its just for demonstration for u people to understand the problem..the compiler cant understand DISTANCE word in this line...
It doesn't know if you mean ::distance (your class) or std::distance. If you hadn't used usingnamespace std; in your code you wouldn't have got this problem.
To fix this either specify that you mean your class by writing ::distance d1,d2,d3;
or remove usingnamespace std; (I recommend this solution)