Talk:Qt thread-safe singleton: Difference between revisions
Jump to navigation
Jump to search
(Compilation error) |
(Reply query) |
||
(One intermediate revision by one other user not shown) | |||
Line 22: | Line 22: | ||
Does this make sense? | Does this make sense? | ||
== Original version? == | |||
Is there a way to see the original content of this page? I'm assuming the info was moved somewhere, but I can't find it? | |||
: The content was deleted in December 2018 because a team of documentation contributors reviewed the code and found it to be excessively convoluted. --[[User:JKSH|JKSH]] ([[User talk:JKSH|talk]]) 10:40, 3 February 2019 (UTC) |
Latest revision as of 10:40, 3 February 2019
(not sure if this is the right place for comments)
With the newest update to this page (Dec 2016) https://wiki.qt.io/index.php?title=Qt_thread-safe_singleton&oldid=29503 , I cannot compile the code. Basically, when I call
Singleton<Origo>::Instance(MyClass::CreateInstance)
I get:
../app/include/app/Singleton.h:38:29: error: cannot initialize a parameter of type 'Type' (aka 'void *(*)()') with an lvalue of type 'CreateInstanceFunction' (aka 'MyClass *(*)()'): different return type ('void *' vs 'MyClass *')
Singleton::create.store(create);
I THINK the fix for this is to change the declaration of create to:
static QBasicAtomicPointer<T* (void)> create;
(and same with the template instantiation at the end)
Does this make sense?
Original version?
Is there a way to see the original content of this page? I'm assuming the info was moved somewhere, but I can't find it?