Original Post
Hello, I am wondering if there was a way to make a vector in a class readonly to everyother class and read/write as normal for itself. I tried simply making a public, const pointer to the vector, which kinda worked, but I was unable to loop through the vector with iterators without typecasting away the const iterator by doing something like:
for(vectorif I remove the (int *) typecast, the compiler complains. If I typecast I defeat the purpose of the const. Is there a good way to do this without wrapping the vector functionallity with public member functions in my class? Thanks! Dwiel [edited by - Tazzel3d on November 20, 2003 7:18:44 PM]::iterator itor = (int *)cls.vec->begin(); itor != cls.vec->end(); ++itor){}