lundi 30 mai 2016

Is it possible in C++ to access to global template variable throw non template function

I have template class Application

It should be something like singleton, I want to create it once, and get from other files.

//main.cpp
Application<NetworkService, User, Policy> a;
a.run();
//other files
//instead of auto a = Application::getInstance<NetworkService, User, Policy>() I want just
auto a = Application::getInstance()

Is it possible? Maybe in another form, I just don't want to use template specification to access to created early global Application object

Aucun commentaire:

Enregistrer un commentaire