Is there any way you can have a constructor fail so that the class isn't created? i.e.
Code:Socket::Socket(char *addr, int port) { if (connect(addr, port) == FAIL) { fail; } }Code:int main() { Socket *sock = new Socket("google.com", 80); if (sock == NULL) { printf("It didn't work\n"); return 0; } }