-
Notifications
You must be signed in to change notification settings - Fork 25
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
improved and more frequent hash implementations #485
Conversation
Better fix for #482
Thanks for the PR. Thank you! In file included from ../../klog/src/awardswidget.cpp:27: In file included from ../../klog/src/awardswidget.h:33: In file included from ../../klog/src/dataproxy_sqlite.h:33: ../../klog/src/qso.h:417:51: error: expected unqualified-id static QHash> SetDataHash; ^ ../../klog/src/qso.h:417:52: error: expected expression static QHash> SetDataHash; ^ ../../klog/src/qso.h:417:54: error: expected expression static QHash> SetDataHash; ^ ../../klog/src/qso.h:417:32: error: no member named '_Mem_fn' in namespace 'std'; did you mean 'mem_fun'? static QHash> SetDataHash; ~~~~~^~~~~~~ mem_fun /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.3.sdk/usr/include/c++/v1/functional:1157:1: note: 'mem_fun' declared here mem_fun(_Sp (_Tp::*__f)()) ^ In file included from ../../klog/src/awardswidget.cpp:27: In file included from ../../klog/src/awardswidget.h:33: In file included from ../../klog/src/dataproxy_sqlite.h:33: ../../klog/src/qso.h:417:70: error: expected member name or ';' after declaration specifiers static QHash> SetDataHash; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^ In file included from ../../klog/src/charts/statsfieldperbandwidget.cpp:26: In file included from ../../klog/src/charts/statsfieldperbandwidget.h:34: In file included from ../../klog/src/charts/../dataproxy_sqlite.h:33: ../../klog/src/qso.h:417:51: error: expected unqualified-id static QHash> SetDataHash; ^ ../../klog/src/qso.h:417:52: error: expected expression static QHash> SetDataHash; ^ ../../klog/src/qso.h:417:54: error: expected expression static QHash> SetDataHash; ^ ../../klog/src/qso.h:417:32: error: no member named '_Mem_fn' in namespace 'std'; did you mean 'mem_fun'? static QHash> SetDataHash; ~~~~~^~~~~~~ mem_fun /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.3.sdk/usr/include/c++/v1/functional:1157:1: note: 'mem_fun' declared here mem_fun(_Sp (_Tp::*__f)()) ^ In file included from ../../klog/src/charts/statsfieldperbandwidget.cpp:26: In file included from ../../klog/src/charts/statsfieldperbandwidget.h:34: In file included from ../../klog/src/charts/../dataproxy_sqlite.h:33: ../../klog/src/qso.h:417:70: error: expected member name or ';' after declaration specifiers static QHash> SetDataHash; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^ In file included from ../../klog/src/main.cpp:39: In file included from ../../klog/src/mainwindow.h:38: In file included from ../../klog/src/setupdialog.h:31: In file included from ../../klog/src/setuppages/setuppageuserdata.h:31: In file included from ../../klog/src/setuppages/../world.h:42: In file included from ../../klog/src/dataproxy_sqlite.h:33: ../../klog/src/qso.h:417:51: error: expected unqualified-id static QHash> SetDataHash; ^ ../../klog/src/qso.h:417:52: error: expected expression static QHash> SetDataHash; ^ ../../klog/src/qso.h:417:54: error: expected expression static QHash> SetDataHash; ^ ../../klog/src/qso.h:417:32: error: no member named '_Mem_fn' in namespace 'std'; did you mean 'mem_fun'? static QHash> SetDataHash; ~~~~~^~~~~~~ mem_fun /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.3.sdk/usr/include/c++/v1/functional:1157:1: note: 'mem_fun' declared here mem_fun(_Sp (_Tp::*__f)()) ^ In file included from ../../klog/src/main.cpp:39: In file included from ../../klog/src/mainwindow.h:38: In file included from ../../klog/src/setupdialog.h:31: In file included from ../../klog/src/setuppages/setuppageuserdata.h:31: In file included from ../../klog/src/setuppages/../world.h:42: In file included from ../../klog/src/dataproxy_sqlite.h:33: ../../klog/src/qso.h:417:70: error: expected member name or ';' after declaration specifiers static QHash> SetDataHash; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^ ../../klog/src/charts/statsfieldperbandwidget.cpp:28:109: warning: unused parameter 'parent' [-Wunused-parameter] StatsFieldPerBandWidget::StatsFieldPerBandWidget(DataProxy_SQLite *dp, ValidFieldsForStats _field, QWidget *parent) ^ In file included from ../../klog/src/elogqrzlog.cpp:27: In file included from ../../klog/src/elogqrzlog.h:39: In file included from ../../klog/src/dataproxy_sqlite.h:33: ../../klog/src/qso.h:417:51: error: expected unqualified-id static QHash> SetDataHash; ^ ../../klog/src/qso.h:417:52: error: expected expression static QHash> SetDataHash; ^ ../../klog/src/qso.h:417:54: error: expected expression static QHash> SetDataHash; ^ ../../klog/src/qso.h:417:32: error: no member named '_Mem_fn' in namespace 'std'; did you mean 'mem_fun'? static QHash> SetDataHash; ~~~~~^~~~~~~ mem_fun /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.3.sdk/usr/include/c++/v1/functional:1157:1: note: 'mem_fun' declared here mem_fun(_Sp (_Tp::*__f)()) ^ In file included from ../../klog/src/elogqrzlog.cpp:27: In file included from ../../klog/src/elogqrzlog.h:39: In file included from ../../klog/src/dataproxy_sqlite.h:33: ../../klog/src/qso.h:417:70: error: expected member name or ';' after declaration specifiers static QHash> SetDataHash; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^ ../../klog/src/elogqrzlog.cpp:34:61: warning: unused parameter '_parentFunction' [-Wunused-parameter] eLogQrzLog::eLogQrzLog(DataProxy_SQLite *dp, const QString &_parentFunction, const QString &_klogVersion) ^ ../../klog/src/elogqrzlog.cpp:70:46: warning: unused parameter '_func' [-Wunused-parameter] void eLogQrzLog::showDebugLog(const QString &_func, const QString &_log) ^ ../../klog/src/elogqrzlog.cpp:70:68: warning: unused parameter '_log' [-Wunused-parameter] void eLogQrzLog::showDebugLog(const QString &_func, const QString &_log) ^ 5 errors generated. make: *** [build/obj/awardswidget.o] Error 1 make: *** Waiting for unfinished jobs.... 1 warning and 5 errors generated. make: *** [build/obj/statsfieldperbandwidget.o] Error 1 3 warnings and 5 errors generated. make: *** [build/obj/elogqrzlog.o] Error 1 5 errors generated. make: *** [build/obj/main.o] Error 1 00:41:54: The process "/usr/bin/make" exited with code 2. Error while building/deploying project KLog (kit: Desktop Qt 5.15.2 clang 64bit) When executing step "Make" 00:41:54: Elapsed time: 00:09. |
Oh I see the problem. Lines 416 in QSO.h and 2616 in QSO.cpp aren't portable to macOS. Using a decltype should fix that. Line 416 should be changed to: and line 2616 should be changed to: |
The line in qso.h seems to be OK but not the one for qso.cpp. I have never used those templates neither these functions... |
Do you think you could send me the build error log.
Sure. For the cliffnotes version, std::mem_fn is essentially just a wrapper for a function pointer, more specifically a member function pointer. Unfortunately mem_fn has unspecified return type, so to get around this I thought that using decltype would work (apparently it didn't). Here's some more detailed explanations of them. |
I had to change the line of qso.h to: In the qso.cpp: I get an error in the lines after I have renamed "_Mem_fn" to "mem_fn" like this: The error I get is: If I try to compile I get the following: (please know that I have not changed the "_Mem_fn" to "mem_fn" except in the first line: ===== compilation errors ==== |
Ok thank you, that was another mistake on my end. I had forgotten that there were additional usages of _mem_fn inside the initializehash() function. To fix that just find and replace all occurrences of "std::_Mem_fn<bool(QSO::*)(const QString&)>" with "decltype(std::mem_fn(&QSO::setSig))" and that should fix it |
@ea4k I've added some commits that should fix any build issues, do you think you could take a look when you have time. Best, |
The PR compiles in my system but crashes on KLog start. |
No description provided.