|
-
April 9th, 2007, 11:59 AM
#13
Re: Casting - bad design?
 Originally Posted by TheCPUWizard
While casts were definately required with 1.x containers it was always recommended to create a type safe wrapper class so that all of the casts were localized to that class (try saying that three times fast!) and that casts were not required outside the typesafe container.
Writing a wrapper doesn't sort out the basic underlying issue of the type system. Isn't it? Rather than patch-work that needed a more basic fix in the framework. Limiting the scope of the problem doesn't mean that the problem doesn't exist. As for lassunde's question, he/she can use casting as much as wanted and localize that code to his own API layer. Is that justified? Moreover, there are efficiency issues related to that.
Also, when I said non-generic containers - that implied those off the pre-2.0 releases that included generics (1.x or whatever). Isn't it?
Can you help me with my homework assignment?, Before you post!, Use code tags, How to post!, Codeguru technical FAQs, C++ FAQ Lite, Stroustrup: C++ Style and Technique FAQ, Guru of the Week, Comeau C and C++ FAQs, Comeau C++ Templates FAQs, CUJ @ DDJ, Spam threshold
My Blogs : Learning C++ is fun | Abnegator's reflections
Open Threads : C++ Aha! Moments | Nature of work in C++?
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|