Thread: Mutator function Question

  1. #1
    Registered User
    Join Date
    Aug 2006
    Posts
    45

    Mutator function Question

    Hi,

    Is it worth doing what ive done in the following code?

    Is it worth checking that I have correctly set the value I wanted to set, or is this almost completely guaranteed and not worth the extra computing cycles?

    code:

    Code:
    bool xViewPlane::setVPlaneH(const int height){
    	vPlaneH = height;
    	if(vPlaneH == height)
    		return true;
    	return false;
    }
    Many Thanks
    -Alex

  2. #2
    Dr Dipshi++ mike_g's Avatar
    Join Date
    Oct 2006
    Location
    On me hyperplane
    Posts
    1,218
    In a word: No.

  3. #3
    Registered User
    Join Date
    Aug 2006
    Posts
    45
    Ok,

    thought so.. Thanks for the confirmation though!

    Cheers
    -Alex

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Alice....
    By Lurker in forum A Brief History of Cprogramming.com
    Replies: 16
    Last Post: 06-20-2005, 02:51 PM
  2. Debugging question
    By o_0 in forum C Programming
    Replies: 9
    Last Post: 10-10-2004, 05:51 PM
  3. Question about pointers #2
    By maxhavoc in forum C++ Programming
    Replies: 28
    Last Post: 06-21-2004, 12:52 PM
  4. Question...
    By TechWins in forum A Brief History of Cprogramming.com
    Replies: 16
    Last Post: 07-28-2003, 09:47 PM
  5. Question, question!
    By oskilian in forum A Brief History of Cprogramming.com
    Replies: 5
    Last Post: 12-24-2001, 01:47 AM