+
+/**
+Registers the class to be used for program startup. The main application class
+should be derived from this.
+*/
+template<typename T>
+class RegisteredApplication: public Application
+{
+private:
+ class Starter: public Application::Starter
+ {
+ public:
+ Application *create_app(int argc, char **argv) { return new T(argc, argv); }
+ };
+
+ static Starter starter_;
+
+protected:
+ // Force the starter into existence
+ RegisteredApplication() { (void)starter_; }