![]() |
|
This thread is locked; no one can reply to it.
![]() ![]() |
1
2
|
Keep track of iterator progress |
SiegeLord
Member #7,827
October 2006
![]() |
Thomas Fjellstrom said: A role is some behavior you want, some action you want to do. Basically you can compose your object out of distinct singular roles. So... multiple inheritance? Even syntax is the same... axilmar said: Yes, and the implementation of those methods could call the relevant <algorithm> functions. What if you wanted to make a new <algorithm>-like function yourself? How would you use your function on the built-in containers? I fail to see how your approach is more extensible than even the broken iterators of C++. "For in much wisdom is much grief: and he that increases knowledge increases sorrow."-Ecclesiastes 1:18 |
axilmar
Member #1,204
April 2001
|
SiegeLord said: What if you wanted to make a new <algorithm>-like function yourself? How would you use your function on the built-in containers? I fail to see how your approach is more extensible than even the broken iterators of C++. It depends. If I was using the new algorithm for an application, then I would do a stand-alone function. If I was making a library that extends the stl, I would do a standalone function and then subclasses of stl containers with methods that call the new standalone function. |
Thomas Fjellstrom
Member #476
June 2000
![]() |
SiegeLord said: So... multiple inheritance? Even syntax is the same... Not quite, I suppose its more of a "mixin" than MI if you know what that is. It doesn't have the same problems MI has at least. -- |
Bob
Free Market Evangelist
September 2000
![]() |
Create your own thread if you want to bash and/or praise C++. -- |
anonymous
Member #8025
November 2006
|
But what exactly would be the benefit of doing: class mycontainer does sortable does findable does foreachable does copyable does ... 200 more roles?
May-be an example? What would sortable look like, and what would it mean to the single linked list container I'd implement? |
axilmar
Member #1,204
April 2001
|
The only thing the 'does' syntax reminds me of is 'Debby does...' ;-) |
|
1
2
|