From: Grzegorz J. <ja...@he...> - 2004-03-05 01:40:34
|
On Thu, 4 Mar 2004, SF Markus Elfring wrote: > > Do you think that in general it is better to return an object rather > > then NULL pointer? If so, why? > > The traditional or C style handling of linked list uses the NULL > pointer as a special marker. Agreed. > It can be used in encapsulated C++ > methods, too. Agreed. > Another design might be to connect the pointers to a > ring. Agreed. > The STL consistently uses iterators. Agreed, but I see no connection to previous sentences. > There is no need to deal > with pointers directly. I could agree (dependes on what "to deal with pointers directly" means), but this does not answer the question. The question was: Do you think that in general it is better to return an object rather than NULL pointer? If so, why? > Please look at the section "Invariants", for > example. http://www.zib.de/benger/STL/Container.html I fail to see how this answers my question. Markus, I is very nice talking to you, but we arrive nowhere. Discussion means asking questions and ANSWERING them. You asked some questions. I answered all your questions I understood. In order to get better understanding of your point, I asked you some questions (e.g. the question at the top of this e-mail). You did not answer them (e.g. it is still unclear to me if you think it is better to return an object or a NULL pointer). I would appreciate if you could go back to previous postings in our discussion to address the questions I asked. That would let us move forward with substantial discussion. Best regards Grzegorz ################################################################## # Grzegorz Jakacki Huada Electronic Design # # Senior Engineer, CAD Dept. 1 Gaojiayuan, Chaoyang # # tel. +86-10-64365577 x2074 Beijing 100015, China # # Copyright (C) 2003 Grzegorz Jakacki, HED. All Rights Reserved. # ################################################################## |