Velocity Reviews

Velocity Reviews (http://www.velocityreviews.com/forums/index.php)
-   C++ (http://www.velocityreviews.com/forums/f39-c.html)
-   -   Problem in calling an overloaded operator= from inside anotheroverloaded operator (http://www.velocityreviews.com/forums/t752753-problem-in-calling-an-overloaded-operator-from-inside-anotheroverloaded-operator.html)

Afshin 08-12-2011 12:01 PM

Problem in calling an overloaded operator= from inside anotheroverloaded operator
 
Hi everybody,

I am developing code for a scheduling applicaiton in which I have a
class for products (called cProduct) which contains, among others, an
array of class cResource to represent the resources used to process
the product. For both classes (cProduct and cResource), I have defined
overloaded operator= ; with operator= for cResource being called from
inside the overloaded operator= defined for cProduct. The problem is
that calling internal operator= (from inside the opertor= for class
cProduct) leads to an error which is attributed to undefined value for
rhs (being passed from internal call to operator=). I appreciate any
hint or clue on how to fix this problem. Below is a summary of
relevant classes and overloaded operator=:

class cProduct{
public:
cProduct(int ResNum);


All times are GMT. The time now is 11:07 AM.

Powered by vBulletin®. Copyright ©2000 - 2013, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.


1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57