![]() |
|
#1
|
|||
|
|||
Iterator,container,copy LostI have two questions that im so lost with.
First question is about a copy constructor, how do i makes a copy of the Entry container from the object parameter. CPP / C++ / C Code:
and i have two remove functions The first remove function removes based on an Entry object parameter. The object is searched for in the database and removed if found. The second remove function removes an entry from the database referred to by an iterator object. First remove function CPP / C++ / C Code:
am lost on how to do this remove function?? CPP / C++ / C Code:
Any comments and help much thanked. Last edited by LuciWiz : 18-Nov-2006 at 13:04.
Reason: Please insert your C/C++ code between [cpp] & [/cpp] tags
|
|
#2
|
|||
|
|||
Re: Iterator,container,copy LostI have done teh copy constructor is this right??
CPP / C++ / C Code:
|
|
#3
|
||||
|
||||
Re: Iterator,container,copy LostQuote:
CPP / C++ / C Code:
Your copy constructor is seem to be right. |
|
#4
|
|||
|
|||
Re: Iterator,container,copy LostThank you,
|
|
#5
|
|||
|
|||
Re: Iterator,container,copy LostI dont think that worked because i keep on getting errors say that " error C2440: 'initializing' : cannot convert from 'Entry' to 'MediaCatDb'
1> No constructor could take the source type, or constructor overload resolution was ambiguous " and " error C2664: 'std::list<_Ty>::remove' : cannot convert parameter 1 from 'MediaCatDb' to 'const Entry &' 1> with 1> [ 1> _Ty=Entry 1> ] 1> Reason: cannot convert from 'MediaCatDb' to 'const Entry' 1> No user-defined-conversion operator available that can perform this conversion, or the operator cannot be called " do you know what this could mean?? Thanks |
|
#6
|
||||
|
||||
Re: Iterator,container,copy LostSorry i wasn't awake
CPP / C++ / C Code:
Just a remark: if you already have i member function looking like the one under here you dont need the above if you call the member function under here with argument like remove(*it). This will cause *it implicitly to convet to Entry reference object. CPP / C++ / C Code:
|
|
#7
|
|||
|
|||
Re: Iterator,container,copy LostIt still not working error : " no operator found which takes a right-hand operand of type 'const std::list<_Ty>::_Iterator<_Secure_validation>' (or there is no acceptable conversion)
1> with 1> [ 1> _Ty=Entry, 1> _Secure_validation=true 1> ]" my code Code:
in the header file the following is declared Code:
|
|
#8
|
|||
|
|||
Re: Iterator,container,copy LostSloved my prob throught out was nto using this
Container::iterator it = _entries.begin(); |
Recent GIDBlog
Observations of Iraq by crystalattice
| Thread Tools | Search this Thread |
| Rate This Thread | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| help in retrieveItem using a list... I'm lost | febrarierose | C++ Forum | 3 | 29-May-2006 15:03 |
| All my important documents may be lost! | mr5 | Computer Software Forum - Windows | 2 | 15-Sep-2005 03:12 |
| lost me scrollbars! | pixienick | MS Visual C++ / MFC Forum | 1 | 05-Sep-2005 08:19 |
| Checking source codes of image, audio and video files | onauc | C Programming Language | 5 | 26-Feb-2005 21:47 |
| Session Variables lost by Mac? | shrdlu | MySQL / PHP Forum | 1 | 06-Mar-2004 22:55 |
Network Sites: GIDNetwork · GIDWebHosts · GIDSearch · Learning Journal by J de Silva, The