Thread: strange operator

  1. #16
    The superhaterodyne twomers's Avatar
    Join Date
    Dec 2005
    Location
    Ireland
    Posts
    2,273
    Did nobody notice the '<- Rhetorical' in my post ... no?

    >> easily infer what a= min(a,b) meant, while a<?=b is not nearly so obvious.
    True true. But, while it isn't obvious, it is ... (somewhat) decipherable if you know how to use the ? : operator and know about < and > than's.
    Last edited by twomers; 08-21-2006 at 03:53 PM.

  2. #17
    (?<!re)tired Mario F.'s Avatar
    Join Date
    May 2006
    Location
    Ireland
    Posts
    8,446
    That operator is definitely one of those that illudes me. Probably there is some explanation for it other than just "it is quicker to write". However let it be said that the operator is more commonly used in this form:

    int low = x <? y;

    Which probably better shows the advantages. Less typing, less prone to bugs, more easily debuggable just from looking at the code.

    All in all, we could extend this conversation to operators like ->, ->* and the compound assignment operators which invariably are nothing more than a shorthand to ease on the code and make things more readable and consequently easier to debug.
    Last edited by Mario F.; 08-21-2006 at 04:24 PM.
    Originally Posted by brewbuck:
    Reimplementing a large system in another language to get a 25% performance boost is nonsense. It would be cheaper to just get a computer which is 25% faster.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. strange problem with operator overloading
    By misterowakka in forum C++ Programming
    Replies: 3
    Last Post: 01-17-2008, 11:18 AM
  2. Smart pointer class
    By Elysia in forum C++ Programming
    Replies: 63
    Last Post: 11-03-2007, 07:05 AM
  3. Screwy Linker Error - VC2005
    By Tonto in forum C++ Programming
    Replies: 5
    Last Post: 06-19-2007, 02:39 PM
  4. strange linking error with operator overloading
    By George2 in forum C++ Programming
    Replies: 7
    Last Post: 07-03-2006, 07:32 AM
  5. operator overloading and dynamic memory program
    By jlmac2001 in forum C++ Programming
    Replies: 3
    Last Post: 04-06-2003, 11:51 PM