I would like to create a std::list<DcmDataset> to hold a series of images. This doesn't work because DcmDataset defines operator=() as private. Suggestions? (A std::list<DcmDataset*> is a last resort, since I would like the list to clean up it's contained instances.)
This brings up a question. DcmDataset does have a public copy constructor, which confuses me... why is operator=() private? Usually that is done to prevent copying, but the public copy constructor obviously allows that.
Regards,
Jim
STL container of DcmDataset
Moderator: Moderator Team
-
- OFFIS DICOM Team
- Posts: 1444
- Joined: Tue, 2004-11-02, 17:22
- Location: Oldenburg, Germany
- Contact:
The copy constructors and copy assignment operators in the dcmdata module need some overhaul. Part of this has already been done and will be present in the next release. There is no reason why there should not be a copy assignment operator for class DcmDataset, but currently it just does not work (and yes, it was declared private to prevent people from using it).
-
- OFFIS DICOM Team
- Posts: 1444
- Joined: Tue, 2004-11-02, 17:22
- Location: Oldenburg, Germany
- Contact:
No. OFList is essentially the same as std::list. The class implements a true subset of the standard list clas, and if you compile with -DHAVE_STL it is actually just an alias for std::list. Therefore, the same rules apply. Currently you have to use a std::list<DcmDataset *> or OFList<DcmDataset *>. Make sure that the destructor of the class in which you declare the list cares about memory clean-up.
Who is online
Users browsing this forum: Ahrefs [Bot], Bing [Bot], Google [Bot] and 1 guest