Skip to content

Instantly share code, notes, and snippets.

@Madsy
Last active February 24, 2018 00:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Madsy/a2f30e30600a5694b4a1d305e6e3894f to your computer and use it in GitHub Desktop.
Save Madsy/a2f30e30600a5694b4a1d305e6e3894f to your computer and use it in GitHub Desktop.
class A {
private:
int p_i;
public:
A(int i) : p_i(i){}
A(const A& a) : p_i(a.p_i){}
operator int(){ return p_i; }
};
int main(){
A a(1);
A b(a);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment