[Fusion] Assignement from adapted struct to tuple
Hello all,
While I managed to assign an adapted structure to a fusion vector, I
fail to assign the same structure to a legacy tuple. The doc doesn't
mention the assignement operator between two sequences, but I though it
would work. Am I missing something ?
#include
AMDG On 03/29/2011 06:50 AM, Samuel Debionne wrote:
Hello all, While I managed to assign an adapted structure to a fusion vector, I fail to assign the same structure to a legacy tuple. The doc doesn't mention the assignement operator between two sequences, but I though it would work. Am I missing something ?
First of all, this isn't assignment, it's copy construction. Second, boost::tuple doesn't know anything about Fusion. It doesn't have a constructor that takes an arbitrary Fusion sequence.
#include
#include #include struct my_struct { double a; int b; char c; };
BOOST_FUSION_ADAPT_STRUCT( my_struct, (double, a) (int, b) (char, c));
my_struct src; boost::fusion::vector
dest1 = src; //OK boost::tuple dest2 = src; //Fails
In Christ, Steven Watanabe
Hello Steven, Thank you for the fast answer ! My use case was with zip_iterator. I'll try to propose a patch that moves it to Fusion Sequence (rather than plain tuple). Le 29/03/2011 16:44, Steven Watanabe a écrit :
AMDG
On 03/29/2011 06:50 AM, Samuel Debionne wrote:
Hello all, While I managed to assign an adapted structure to a fusion vector, I fail to assign the same structure to a legacy tuple. The doc doesn't mention the assignement operator between two sequences, but I though it would work. Am I missing something ?
First of all, this isn't assignment, it's copy construction. Second, boost::tuple doesn't know anything about Fusion. It doesn't have a constructor that takes an arbitrary Fusion sequence.
Thank you for your fast answer ! My use case was with zip_iterator. I'll try to propose a patch that moves it to Fusion algorithm (rather than plain tuple algorithms). That should make it compatible with more Fusion sequence and solve my problem. Samuel
participants (2)
-
Samuel Debionne
-
Steven Watanabe