Operator that returns no value but returns value

This is a discussion on Operator that returns no value but returns value within the C++ Programming forums, part of the General Programming Boards category; I forget what that damned operator is called that returns no value except it does return a value... It is ...

  1. #1
    Registered User
    Join Date
    Aug 2007
    Posts
    81

    Operator that returns no value but returns value

    I forget what that damned operator is called that returns no value except it does return a value...

    It is used so you can do assignment with your class being an r_value ( the assignment operator isn't a member of your class )

    Does anyone know what i'm talking about? I just need the name of it so i can google it.
    Last edited by keira; 01-19-2008 at 12:58 PM.

  2. #2
    C++ Witch laserlight's Avatar
    Join Date
    Oct 2003
    Location
    Singapore
    Posts
    22,313
    That sounds like a contradiction. As a wild guess, are you talking about conversion functions such as operator int() and operator bool()?
    C + C++ Compiler: MinGW port of GCC
    Version Control System: Bazaar

    Look up a C++ Reference and learn How To Ask Questions The Smart Way

  3. #3
    C++まいる!Cをこわせ!
    Join Date
    Oct 2007
    Posts
    23,033
    Something that returns something yet it does not? Can that be void?
    Quote Originally Posted by Adak View Post
    io.h certainly IS included in some modern compilers. It is no longer part of the standard for C, but it is nevertheless, included in the very latest Pelles C versions.
    Quote Originally Posted by Salem View Post
    You mean it's included as a crutch to help ancient programmers limp along without them having to relearn too much.

    Outside of your DOS world, your header file is meaningless.

  4. #4
    Registered User
    Join Date
    Jan 2005
    Posts
    7,344
    A conversion operator doesn't need to have a return type specified because the return type will always be the type of the operator. However, it does return a value, so I'm guessing laserlight is correct.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Lame null append cause buffer to crash
    By cmoo in forum C Programming
    Replies: 8
    Last Post: 12-29-2008, 03:27 AM
  2. Polynomials and ADT's
    By Emeighty in forum C++ Programming
    Replies: 20
    Last Post: 08-19-2008, 09:32 AM
  3. Function returns null value instead of zero
    By drdepoy in forum C Programming
    Replies: 3
    Last Post: 10-23-2005, 04:51 PM
  4. Replies: 2
    Last Post: 04-12-2004, 02:37 AM
  5. Contest Results - May 27, 2002
    By ygfperson in forum A Brief History of Cprogramming.com
    Replies: 18
    Last Post: 06-18-2002, 02:27 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21