2000

Grusel++ of the month

Home
Download Source
/******************************************************************************/
/*                                                                            */
/*                                                        FILE: SEPTEMBER.CPP */
/*                                                                            */
/*  The wonders of implicit type conversions                                  */
/*  ========================================                                  */
/*                                                                            */
/*  Compiled and tested with Visual C++ V6.0                                  */
/*                                                                            */
/*  V1.00   26-SEP-2000   P. Tellenbach   http://www.heimetli.ch/             */
/*                                                                            */
/******************************************************************************/

#include <iostream>

class ImplicitConversion
{
 public:
   ImplicitConversion()
   {
   }

   ImplicitConversion( const char *str )
   {
      std::cout << str << std::endl ;
   }

   bool operator == ( ImplicitConversion )
   {
      return false ;
   }
} ;

int main()
{
 return ImplicitConversion() == "Hello World !" ;
}

Update 27. September 2020

This program still compiles and runs without any changes.