How can I return to Main from a constructor?

I've got a constructor:

1
2
3
4
5
6
7
// renderer.h  
Renderer();

// renderer.cpp
Renderer::Renderer() {
    // Code
}


Is there any way I can have the constructor return to main at particular point? I'm creating a window within that constructor, but want it to return to main if it fails to do so.
Last edited on
Nevermind, it apparently just continues regardless. Sorry. :)
Yup, the constructor will return to where it was called from.

If you need to detect if an error occurred in a constructor, have the constructor raise an exception and place a try/catch block around where the constructor is called.

Yup, the constructor will return to where it was called from.

Just like any other function (in case that's not clear to the OP).
Topic archived. No new replies allowed.