/******************************************************************************
Welcome to GDB Online.
GDB online is an online compiler and debugger tool for C, C++, Python, Java, PHP, Ruby, Perl,
C#, OCaml, VB, Swift, Pascal, Fortran, Haskell, Objective-C, Assembly, HTML, CSS, JS, SQLite, Prolog.
Code, Compile, Run and Debug online from anywhere in world.
*******************************************************************************/
#include <iostream>
using namespace std;
class String{
public:
operator const char *(){
cout << "op char" << endl;
return "lol";
}
operator bool(){
cout << "op bool" << endl;
return true;
}
String(const char *str){
cout << "String ctor" << endl;
}
String(const String &str){
cout << "copy ctor" << endl;
}
~String(){
cout << "String dtor" << endl;
}
};
int main()
{
String yolo("yolo");
const char* derp; // = yolo ? yolo : "wtf";
if(yolo){
derp = yolo;
}
return 0;
}