Re: [boost] [Fusion] Notice of breaking change

The definition of Fusion polymorphic function object will be changed shortly to be consistent with boost.resultof. Instead of requiring a nested result metafunction of the form:
template<typename T0, typename T1, ... typename TN> struct result { typedef xxx type; };
A polymorphic function object will instead simply be required to suppport
boost::result_of<F(A,B,...Z)>::type
as a valid expression.
This will break some Fusion client code, specifically, if you are using fold, accumulate, transform, or a lot of the components in the functional section of the library, you may need to make changes to support this change.
The change should be entered into CVS head over the forthcoming weekend.
The above change has now been applied. Docs upgrades will follow in the next few days. Thanks Dan ___________________________________________________________ What kind of emailer are you? Find out today - get a free analysis of your email personality. Take the quiz at the Yahoo! Mail Championship. http://uk.rd.yahoo.com/evt=44106/*http://mail.yahoo.net/uk

dan marsden wrote:
The above change has now been applied. Docs upgrades will follow in the next few days.
The usage of boost::result_of is right? IIRC, for example, <transform_view/detail/apply_transform_result.hpp> should be template <typename T0> struct apply<T0, void_> : boost::result_of<F(typename add_reference<T0>::type)> {}; , because the object passed to a functor is lvalue. -- Shunsuke Sogame

I have been using the STL for some time now and have been investigating possible use of the boost libraries in future projects. The most useful library I have found so far was the boost::lamda library. I was reading the documentation and experimenting around with the boost::tuples library. The documentation is excellent and very complete and now I understand how to create tuples and maybe use them is some limited way. Thing is, I can't seem to grasp what advantages there are of tuples over structures and classes? Can someone tell me; what are the benefits of tuples over structures or classes? Thanks, Dennis Bingaman

Dennis Bingaman, A handcrafted struct or class can beat a tuple in all categories except one: time to define it. A tuple shines as a way to return multiple values from a function without haven't to result to creating a struct/class or worse changing the signature of the function/method by having them, the return values, passed in as reference(s) or pointer(s) parameters. The latter would obscure the innate documentation on how a function is to be used. i.e. Is this parameter and in, in/out, or out parameter? Add onto all of this all the methods and operators that get generated for you and the tuple's ease of use become apparent. -----Original Message----- From: boost-bounces@lists.boost.org [mailto:boost-bounces@lists.boost.org] On Behalf Of Dennis D Bingaman Sent: Friday, July 06, 2007 3:19 PM To: boost@lists.boost.org Subject: [boost] boost::tuples I have been using the STL for some time now and have been investigating possible use of the boost libraries in future projects. The most useful library I have found so far was the boost::lamda library. I was reading the documentation and experimenting around with the boost::tuples library. The documentation is excellent and very complete and now I understand how to create tuples and maybe use them is some limited way. Thing is, I can't seem to grasp what advantages there are of tuples over structures and classes? Can someone tell me; what are the benefits of tuples over structures or classes? Thanks, Dennis Bingaman _______________________________________________ Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost

Dennis D Bingaman wrote:
I have been using the STL for some time now and have been investigating possible use of the boost libraries in future projects. The most useful library I have found so far was the boost::lamda library. I was reading the documentation and experimenting around with the boost::tuples library. The documentation is excellent and very complete and now I understand how to create tuples and maybe use them is some limited way. Thing is, I can't seem to grasp what advantages there are of tuples over structures and classes? Can someone tell me; what are the benefits of tuples over structures or classes?
In a word, "genericity". Tuples will let you do things like, ehm Fusion ;-) Regards, -- Joel de Guzman http://www.boost-consulting.com http://spirit.sf.net

On 06/07/07, Dennis D Bingaman <ddbingaman@raytheon.com> wrote:
I have been using the STL for some time now and have been investigating possible use of the boost libraries in future projects. The most useful library I have found so far was the boost::lamda library. I was reading the documentation and experimenting around with the boost::tuples library. The documentation is excellent and very complete and now I understand how to create tuples and maybe use them is some limited way. Thing is, I can't seem to grasp what advantages there are of tuples over structures and classes? Can someone tell me; what are the benefits of tuples over structures or classes?
You might want to look into a language such as ML that has both records (like structs) and tuples built-in, and see where they use which. I think Jarrad Waterloo's explanation is good though. Tuples are great when you need a compound type for some reason, such as returning more than one value from a function, like a map's insert, but that compound type itself is unimportant. Those situations are often also those where the ability to tie comes in very handy. (Which is pretty much just an emulation of the pattern matching in something like ML.) ~ Scott McMurray

I have been using the STL for some time now and have been investigating possible use of the boost libraries in future projects. The most useful library I have found so far was the boost::lamda library. I was reading the documentation and experimenting around with the boost::tuples
Thanks for everyone's input on this. Dennis Bingaman Raytheon "Scott McMurray" <me22.ca+boost@gmail.com> Sent by: boost-bounces@lists.boost.org 07/06/2007 11:36 PM Please respond to boost@lists.boost.org To boost@lists.boost.org cc Subject Re: [boost] boost::tuples On 06/07/07, Dennis D Bingaman <ddbingaman@raytheon.com> wrote: library.
The documentation is excellent and very complete and now I understand how to create tuples and maybe use them is some limited way. Thing is, I can't seem to grasp what advantages there are of tuples over structures and classes? Can someone tell me; what are the benefits of tuples over structures or classes?
You might want to look into a language such as ML that has both records (like structs) and tuples built-in, and see where they use which. I think Jarrad Waterloo's explanation is good though. Tuples are great when you need a compound type for some reason, such as returning more than one value from a function, like a map's insert, but that compound type itself is unimportant. Those situations are often also those where the ability to tie comes in very handy. (Which is pretty much just an emulation of the pattern matching in something like ML.) ~ Scott McMurray _______________________________________________ Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost
participants (6)
-
dan marsden
-
Dennis D Bingaman
-
Jarrad Waterloo
-
Joel de Guzman
-
Scott McMurray
-
shunsuke