I currently working on a class where I want to work with auto-range loops (C++11). As far as I know I need to write an iterator-class to do this.
Since I never wrote an iterator class before, I would like to ḱnow where to save this class. I could write an own, separate header file (and/ or source file) or I write it in the same file as the class where I want to use the iterator. In both cases I need to work with class forward declaration (at least as far as I know). In the second variant I do not need to include the respective header file of the other class (iterator need to include the class where it should iterate and vice versa).
Is there any tip for implementation (which comes in which file and in which order)? I already googled, but I did not find something that satisfied me :-)
Thank you and best regards,
dickmann721
Aucun commentaire:
Enregistrer un commentaire