Why isn't the constructor of Gtk::Application public?
<[email protected]> Tue, 28 Sep 2021 16:07:50 +0200
| Newsgroups | gmane.comp.gnome.gtkmm |
|---|---|
| Message-ID | <20210928160454.126fbec4@phositlinuxtop> |
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?