Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » U++ Library support » U++ Core » NEW: generic Toupel grouper
Re: NEW: generic Toupel grouper [message #28092 is a reply to message #28091] Sun, 15 August 2010 13:09 Go to previous messageGo to previous message
dolik.rce is currently offline  dolik.rce
Messages: 1791
Registered: August 2008
Location: Czech Republic
Ultimate Contributor

Hi Kohait

kohait00 wrote on Sun, 15 August 2010 09:16

dont worry, it's part of development, and didnt feel criticised Smile. i am always looking forward to meeting better ideas..

I don't worry, it was a joke Wink

kohait00 wrote on Sun, 15 August 2010 09:16


the Get<1>() option (idea from boost?) is a cool trick, but IMHO of little use because it's not a runtime check, but a compile time definition, thus u.a, u.b, u.c is much simpler and clearer in that sense, and less to type anyway. i mean, in terms of compile time specialisation u.Get<1> is same as u.a, you have to provide the index at compiletime, so you know which type.

Yes, it is from boost. As I said, it is mostly useless and the only way it might be helpful is making the code look better and hopefully better readable. But I don't insist on having it at all. At least it learned me some interesting new things about templates Smile

kohait00 wrote on Sun, 15 August 2010 09:16


the Value operator[](int i) is a good idea though. to wrap / unwrap in value (boxing / unboxing is used in C# and others, though there in different context, as base class object).

Don't forget about the GetCount() too Wink I just don't like my implementation of it very much, but I can't come up with anything better. And if possible I would also like to see Begin() and End() implemented, so I could do DUMPC(touple)...

kohait00 wrote on Sun, 15 August 2010 09:16


having Duo, Trio, etc is, as you pointed out, more or less useless, even if it's better to read Smile so i added a 5th T and deaulted past second T. (i'd rater use EmptyClass, but there is no Value(const EmptyClass &) for it, so i used Nuller. might be usefull to have an EmptyClass Value as well?)

I would strongly prefer EmptyClass too. But there might be idealogical problem: Once you make it value compatible, it won't be empty any more Smile Maybe we should do a special class for this purpose, let's say DummyElement, which would be Value and Null compatible.

Apart from what I said above, especially the missing GetCount(), your last code seems reasonable. Definitely not that difficult to read as mine Smile (which is good)

Honza

[Updated on: Sun, 15 August 2010 13:10]

Report message to a moderator

 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Date limited to 2020 and 2015 does not work ?!?
Next Topic: Value question (memory consumption)
Goto Forum:
  


Current Time: Sun Apr 27 14:12:17 CEST 2025

Total time taken to generate the page: 0.00922 seconds