T
ttl_idiot
I think this is a C++ question, but you might think its basic:
How can I in a c++ environment let
b when used as an r-value, as in
a = b; // where a is declared as int
mean that a function should be called, and at the same time let
b = a; // a is still declared as int
mean that another function should be called, with the argument a.
The first I can solve with
#define b f()
and the second I can solve with b being an object and overloading the
assignment operator.
But how can I do both at the same time?
(Please dont tell me to rewrite the code - that is, besides beeing
obvious, totally out of the question, due to reasons that is a little
hard to explain - but it has to do with using multiple compilers at the
same time, one of them beeing pure C.)
If this simply cant be done withing the C++ language, it would be
useful for me to know. Any comments please? Thank you.
How can I in a c++ environment let
b when used as an r-value, as in
a = b; // where a is declared as int
mean that a function should be called, and at the same time let
b = a; // a is still declared as int
mean that another function should be called, with the argument a.
The first I can solve with
#define b f()
and the second I can solve with b being an object and overloading the
assignment operator.
But how can I do both at the same time?
(Please dont tell me to rewrite the code - that is, besides beeing
obvious, totally out of the question, due to reasons that is a little
hard to explain - but it has to do with using multiple compilers at the
same time, one of them beeing pure C.)
If this simply cant be done withing the C++ language, it would be
useful for me to know. Any comments please? Thank you.