Results 1 to 3 of 3

Thread: Class operators [RESOLVED]

Threaded View

  1. #1

    Thread Starter
    Fanatic Member
    Join Date
    Jan 2003
    Posts
    1,004

    Class operators [RESOLVED]

    Say that we had a class, A, in which is defined as such:

    Code:
    class A
    {
    	public:
    		A& operator=(const A& rhs);
    		A operator+(const float &rhs) const;
    }
    Now this would allow us to do things such as:

    Code:
    A = A + 5;
    How could we make it so that:

    Code:
    A = 5 + A;
    would be valid?
    Last edited by Darkwraith; Jun 8th, 2004 at 08:28 PM.
    "Can't" and "shouldn't" are two totally separate things.

    All questions should be answered. All answers should be true. That is why I post.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width