G
Guest
I'm having trouble using Braid (my user-defined type) objects returned
from functions. I've got:
Braid descend_n(int n, int no_strings)
This function needs to use void left_multiply(Braid&b). When a Braid
calls this, b will call void left_multiply_response(Braid& b2 - I've
forgotten for now how I did this but b2 is the braid that called
l-multiply). This may be something to do with the problem, I don't
know.
I've also tried changing the function return type from Braid to Braid&
without affecting the situation at all.
Anyway, I've tried to use b.left_multiply(descend_n(n-1, no_strings));
in my code. Whereupon I get a compiler error message saying I can't
pass a Braid, only a Braid&, as a parameter. I've tried putting * and
& before descend_n with no luck (this may partly be because I
overloaded * to multiply Braids together?)
Can anyone tell me what to do that wouldn't require me to try
something like
Braid b3=descend_n(ETC);
b.left_multiply(b3);
as I have a feeling being able to use the function results directly
could be very useful a lot of times in the new functions I'm writing
now.
Thanks!
James McLaughlin.
from functions. I've got:
Braid descend_n(int n, int no_strings)
This function needs to use void left_multiply(Braid&b). When a Braid
calls this, b will call void left_multiply_response(Braid& b2 - I've
forgotten for now how I did this but b2 is the braid that called
l-multiply). This may be something to do with the problem, I don't
know.
I've also tried changing the function return type from Braid to Braid&
without affecting the situation at all.
Anyway, I've tried to use b.left_multiply(descend_n(n-1, no_strings));
in my code. Whereupon I get a compiler error message saying I can't
pass a Braid, only a Braid&, as a parameter. I've tried putting * and
& before descend_n with no luck (this may partly be because I
overloaded * to multiply Braids together?)
Can anyone tell me what to do that wouldn't require me to try
something like
Braid b3=descend_n(ETC);
b.left_multiply(b3);
as I have a feeling being able to use the function results directly
could be very useful a lot of times in the new functions I'm writing
now.
Thanks!
James McLaughlin.