I just tried to recompile LyX on MSVC 19, this is the error I get:
[ 40%] Building CXX object
src/frontends/qt/CMakeFiles/frontend_qt.dir/GuiApplication.cpp.obj
GuiApplication.cpp
D:\LyX\lyx-unstable\3rdparty\nod\nod.hpp(272): error C2653: 'result_of': is
not a class or namespace name
D:\LyX\lyx-unstable\3rdparty\nod\nod.hpp(323): note: see reference to class
template instantiation 'nod::signal_accumulator<S,T,F,A...>' being compiled
D:\LyX\lyx-unstable\3rdparty\nod\nod.hpp(272): error C2146: syntax error:
missing ';' before identifier 'type'
D:\LyX\lyx-unstable\3rdparty\nod\nod.hpp(272): error C4430: missing type
specifier - int assumed. Note: C++ does not support default-int
It looks like it's due to bda45704005d6b328e18457a07d05e56883c2874, with
the replacement of boost::signals2 (a heavy library) by nod (an
unmaintained library). It's about things that are getting deleted in the
latest versions of C++, meaning that it will probably bite other compilers
at some point in the future.
As the author of the library did not answer to PRs in the last two years,
I'm not sure it's possible to upstream changes to it… What would be best in
this case?
I assume that you are compiling LyX in C++20 mode since `result_of` is
only deprecated in C++17. Does the attached patch resolves this issue?
(It is strange, but seems like result_of still exists in C++20 mode of
GCC...)
The nod library is pretty small and I suppose the only maintenance will
be due to backward incompatibilities of newer C++ standards.
Yuriy
diff --git a/3rdparty/nod/nod.hpp b/3rdparty/nod/nod.hpp
index 5c4a93cb85..86492d6d00 100644
--- a/3rdparty/nod/nod.hpp
+++ b/3rdparty/nod/nod.hpp
@@ -269,7 +269,11 @@ namespace nod {
{
public:
/// Result type when calling the accumulating function
operator.
- using result_type = typename std::result_of<F(T,
typename S::slot_type::result_type)>::type;
+#if __cplusplus >= 201703L
+ using result_type = typename std::invoke_result<F, T, typename
S::slot_type::result_type>::type;
+#else
+ using result_type = typename std::result_of<F(T, typename
S::slot_type::result_type)>::type;
+#endif
/// Construct a signal_accumulator as a proxy to a
given signal
//
--
lyx-devel mailing list
lyx-devel@lists.lyx.org
http://lists.lyx.org/mailman/listinfo/lyx-devel