Why isn't the constructor of Gtk::Application public?



Hello

Most times Gtk::Application is only used like this:

auto app = Gtk::Application::create("org.example");
return app->make_window_and_run<MyWindow>(argc, argv);

If the constructor would be public we and the compiler wouldn't have to
deal with smart pointers:

Gtk::Application app("org.example");
return app.make_window_and_run<MyWindow>(argc, argv);

The Gtk::Application::create function just passes the argument to the
constructor and stores the Gtk::Application in a Glib::RefPtr. Is there
a reason why the constructor isn't public?


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]