mirror of
https://github.com/QuasarApp/QuasarAppLib.git
synced 2025-04-29 11:14:39 +00:00
Merge pull request #37 from QuasarApp/task_111_fix
Added change in template method instance
This commit is contained in:
commit
0c04d41712
@ -40,13 +40,13 @@ public:
|
|||||||
* @brief instance This method return instance of the settings object
|
* @brief instance This method return instance of the settings object
|
||||||
* @return pointer to a settings object;
|
* @return pointer to a settings object;
|
||||||
*/
|
*/
|
||||||
template <class SettingsType>
|
template <class SettingsType, class... Args>
|
||||||
static ISettings* instance() {
|
static ISettings* instance(Args&&... args) {
|
||||||
static_assert (std::is_base_of<SettingsType, ISettings>::value,
|
static_assert (std::is_base_of<ISettings, SettingsType>::value,
|
||||||
"the Settingstype type must be ISettings");
|
"the Settingstype type must be ISettings");
|
||||||
|
|
||||||
if(!_settings){
|
if(!_settings){
|
||||||
_settings = new SettingsType();
|
_settings = new SettingsType(std::forward<Args>(args)...);
|
||||||
}
|
}
|
||||||
|
|
||||||
return _settings;
|
return _settings;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user