|
-
November 18th, 2008, 05:40 AM
#11
Re: Forward declarations and covariate return types
 Originally Posted by cooperised
I'd like to take the opportunity to respond to the emerging debate about whether this workaround is necessary because of failings in my design. I would, in general, wholeheartedly agree with Graham's dictum - but not always.
All the aphorisms I work by come with the caveat: "but there will be pathological cases".
 Originally Posted by cooperised
[...]For those who are interested, the reason that the 'getTranspose()' method is virtual is that the much-simplified inheritance tree I presented when asking my original question is part of a larger one that includes non-square, square, symmetric, and diagonal matrices. Transposition is a valid operation for all of these types, but since their implementations vary widely for efficiency (interface and implementation are kept well separated) the transpose operation must be virtual.
I had considered that that may well be the case, but I thought that it was worth pointing out, anyway - we've had plenty of cases on here of people heading off in entirely the wrong direction, because they haven't stopped to consider if what they're doing makes sense. I wasn't suggesting that you hadn't, but it was necessary to consider the possibility, given the information supplied.
Correct is better than fast. Simple is better than complex. Clear is better than cute. Safe is better than insecure.
-- Sutter and Alexandrescu, C++ Coding Standards
Programs must be written for people to read, and only incidentally for machines to execute.
-- Harold Abelson and Gerald Jay Sussman
The cheapest, fastest and most reliable components of a computer system are those that aren't there.
-- Gordon Bell
Tags for this Thread
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
|