[tuple] which version to take ?

Dear all, I am not sure which version of tuples is actual and should be used: -The version in boost/tuple is working and seems consitent to the manual on the boost homepage. -The version in boost/spirit/fusion/sequence is working too and seems to be consistent to "C++ Standard Library Technical Report". tuple_size and tuple_element exist, which do not exist in the first version. Why are there two versions? Which one shall I use? Any recommendations? Thank you, Patrick P.S.: I have another short question, and need a small hint (what to search ;) ) for kind of a "compile time for-loop". Something like this: index[0] = fw_index::template get_index< tuples::tuple_element< 0, TTuple>::type >(); index[1] = fw_index::template get_index< tuples::tuple_element< 1, TTuple>::type >(); ...

On Oct 27, 2004, at 4:22 AM, Patrick Kowalzick wrote:
Dear all,
I am not sure which version of tuples is actual and should be used:
-The version in boost/tuple is working and seems consitent to the manual on the boost homepage.
-The version in boost/spirit/fusion/sequence is working too and seems to be consistent to "C++ Standard Library Technical Report". tuple_size and tuple_element exist, which do not exist in the first version.
Why are there two versions?
The former was the original Tuples library, whereas the latter was written later according to the exact wording of the Library TR using a different implementation technique.
Which one shall I use?
It doesn't really matter... you may get better performance (compile-time and run-time) out of the Fusion version, but it's also unreviewed code. [*] I tend to use the original boost/tuple out of habit.
P.S.: I have another short question, and need a small hint (what to search ;) ) for kind of a "compile time for-loop". Something like this: index[0] = fw_index::template get_index< tuples::tuple_element< 0, TTuple>::type >(); index[1] = fw_index::template get_index< tuples::tuple_element< 1, TTuple>::type >(); ...
Todd Veldhuizen's web page on template metaprogramming might be a good start: http://osl.iu.edu/~tveldhui/papers/Template-Metaprograms/meta-art.html Or, if you can hold off a few weeks, David Abrahams and Aleksey Gurtovoy have written a more extensive book on template metaprogramming: http://www.awprofessional.com/title/0321227255 Doug [*] It's undoubtedly correct code, but still...

Hi Doug,
It doesn't really matter... you may get better performance (compile-time and run-time) out of the Fusion version, but it's also unreviewed code. [*] I tend to use the original boost/tuple out of habit.
Ok. Then I will take the risk ;) and take the fusion one ( tuple_element and tuple_size implemented).
http://osl.iu.edu/~tveldhui/papers/Template-Metaprograms/meta-art.html
Yep, thats a good start. I try to find the passages.
Or, if you can hold off a few weeks, David Abrahams and Aleksey Gurtovoy have written a more extensive book on template metaprogramming:
No - I can not hold off anymore. I ordered it 4 weeks ago. I wanna read it NOW, NOW, NOW ;). Thanks a lot, Patrick

"Patrick Kowalzick" <Patrick.Kowalzick@cern.ch> writes:
Or, if you can hold off a few weeks, David Abrahams and Aleksey Gurtovoy have written a more extensive book on template metaprogramming:
No - I can not hold off anymore. I ordered it 4 weeks ago. I wanna read it NOW, NOW, NOW ;).
Unfortunately for you, we don't cover Fusion, since it wasn't solid enough at the time of our writing. The next important move will be for someone to document it. -- Dave Abrahams Boost Consulting http://www.boost-consulting.com

David Abrahams wrote:
"Patrick Kowalzick" <Patrick.Kowalzick@cern.ch> writes:
Or, if you can hold off a few weeks, David Abrahams and Aleksey Gurtovoy have written a more extensive book on template metaprogramming:
No - I can not hold off anymore. I ordered it 4 weeks ago. I wanna read it NOW, NOW, NOW ;).
Unfortunately for you, we don't cover Fusion, since it wasn't solid enough at the time of our writing. The next important move will be for someone to document it.
That's no. 2 in my documentation-todo-list. No. 1 is Phoenix2, which I am doing right now. Regards, -- Joel de Guzman http://www.boost-consulting.com http://spirit.sf.net

Hello all,
Or, if you can hold off a few weeks, David Abrahams and Aleksey Gurtovoy have written a more extensive book on template metaprogramming:
No - I can not hold off anymore. I ordered it 4 weeks ago. I wanna read it NOW, NOW, NOW ;).
Unfortunately for you, we don't cover Fusion, since it wasn't solid enough at the time of our writing. The next important move will be for someone to document it.
Oh, this I do not mind. I just hope to get new insight ;). Regarding my OP, I have another question. I read this here: http://pluralsight.com/blogs/hsutter/archive/2004/10/23/2972.aspx and took a short look on the "Library extensions" paper (specially regarding the tuples and the array) but I was not yet able to figure out what is going to be part of the standard and what not. Where can I find these informations? Thanks, Patrick

At 04:36 PM 11/1/2004, Patrick Kowalzick wrote:
Regarding my OP, I have another question. I read this here: http://pluralsight.com/blogs/hsutter/archive/2004/10/23/2972.aspx and took a short look on the "Library extensions" paper (specially regarding the tuples and the array) but I was not yet able to figure out what is going to be part of the standard and what not. Where can I find these informations?
The final editing of the Library TR is underway now. Once it is finished, the TR will be posted at http://www.open-std.org/jtc1/sc22/wg21/ as one of the "papers". Questions about the standard should really be posted on comp.std.c++. --Beman

"Patrick Kowalzick" <patrick.kowalzick@web.de> writes:
Hello all,
Or, if you can hold off a few weeks, David Abrahams and Aleksey Gurtovoy have written a more extensive book on template metaprogramming:
No - I can not hold off anymore. I ordered it 4 weeks ago. I wanna read it NOW, NOW, NOW ;).
Unfortunately for you, we don't cover Fusion, since it wasn't solid enough at the time of our writing. The next important move will be for someone to document it.
Oh, this I do not mind. I just hope to get new insight ;).
Regarding my OP, I have another question. I read this here: http://pluralsight.com/blogs/hsutter/archive/2004/10/23/2972.aspx and took a short look on the "Library extensions" paper (specially regarding the tuples and the array) but I was not yet able to figure out what is going to be part of the standard and what not. Where can I find these informations?
http://www.open-std.org/jtc1/sc22/wg21/docs/library_technical_report.html -- Dave Abrahams Boost Consulting http://www.boost-consulting.com
participants (6)
-
Beman Dawes
-
David Abrahams
-
Doug Gregor
-
Joel
-
Patrick Kowalzick
-
Patrick Kowalzick