How does a class name return an expression

This is a discussion on How does a class name return an expression within the C++ Programming forums, part of the General Programming Boards category; How can the name of an object of a class be used as an expression, like what would I need ...

  1. #1
    Registered User Kirdra's Avatar
    Join Date
    Aug 2002
    Posts
    105

    How does a class name return an expression

    How can the name of an object of a class be used as an expression, like what would I need to do in the class definition? I'm thinking something along the lines of how std::cin can be used to check if the stream is in a good state.

    Thanks.
    Last edited by Kirdra; 10-07-2010 at 10:32 AM.

  2. #2
    Registered User hk_mp5kpdw's Avatar
    Join Date
    Jan 2002
    Location
    Northern Virginia/Washington DC Metropolitan Area
    Posts
    3,673
    You mean like the safe bool idiom?
    I used to be an adventurer like you... then I took an arrow to the knee.

  3. #3
    Registered User Kirdra's Avatar
    Join Date
    Aug 2002
    Posts
    105
    Thanks for the quick response, that's what i was looking for.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Code review
    By Elysia in forum C++ Programming
    Replies: 71
    Last Post: 05-13-2008, 09:42 PM
  2. Weird errors.
    By Desolation in forum C++ Programming
    Replies: 20
    Last Post: 05-09-2007, 01:10 PM
  3. Dikumud
    By maxorator in forum C++ Programming
    Replies: 1
    Last Post: 10-01-2005, 06:39 AM
  4. Pong is completed!!!
    By Shamino in forum Game Programming
    Replies: 11
    Last Post: 05-26-2005, 10:50 AM
  5. Contest Results - May 27, 2002
    By ygfperson in forum A Brief History of Cprogramming.com
    Replies: 18
    Last Post: 06-18-2002, 01:27 PM

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