You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I made a mistake with passing 2 args lambda to observe a single signal.
intmain()
{
ureact::context ctx;
ureact::value<int> a = make_value( ctx, 1 );
ureact::value<int> b = make_value( ctx, 1 );
auto obs = ureact::observe( a + b, []( int a, int b ){} );
}
I received the following error message:
In file included from D:/mingw32/lib/gcc/i686-w64-mingw32/7.3.0/include/c++/bits/move.h:54:0,
from D:/mingw32/lib/gcc/i686-w64-mingw32/7.3.0/include/c++/bits/nested_exception.h:40,
from D:/mingw32/lib/gcc/i686-w64-mingw32/7.3.0/include/c++/exception:143,
from D:/mingw32/lib/gcc/i686-w64-mingw32/7.3.0/include/c++/ios:39,
from D:/mingw32/lib/gcc/i686-w64-mingw32/7.3.0/include/c++/ostream:38,
from D:/mingw32/lib/gcc/i686-w64-mingw32/7.3.0/include/c++/iostream:39,
from D:\Workspace\ureact\tests\src\playground\main.cpp:8:
D:/mingw32/lib/gcc/i686-w64-mingw32/7.3.0/include/c++/type_traits: In substitution of 'template<class _Fn, class ... _Args> using invoke_result_t = typename std::invoke_result::type [with _Fn = main()::<lambda(int, int)>; _Args = {int}]':
D:/Workspace/ureact/include/ureact/ureact.hpp:2284:44: required from 'ureact::v0::observer ureact::v0::detail::observe_impl(const ureact::v0::signal<R>&, in_f&&) [with in_f = main()::<lambda(int, int)>; S = int]'
D:/Workspace/ureact/include/ureact/ureact.hpp:2326:42: required from 'ureact::v0::observer ureact::v0::observe(ureact::v0::signal<R>&&, in_f&&) [with in_f = main()::<lambda(int, int)>; S = int]'
D:\Workspace\ureact\tests\src\playground\main.cpp:22:61: required from here
D:/mingw32/lib/gcc/i686-w64-mingw32/7.3.0/include/c++/type_traits:2836:72: error: no type named 'type' in 'struct std::invoke_result<main()::<lambda(int, int)>, int>'usinginvoke_result_t = typename invoke_result<_Fn, _Args...>::type;
^
In file included from D:\Workspace\ureact\tests\src\playground\main.cpp:10:0:
D:/Workspace/ureact/include/ureact/ureact.hpp: In instantiation of 'ureact::v0::observer ureact::v0::detail::observe_impl(const ureact::v0::signal<R>&, in_f&&) [with in_f = main()::<lambda(int, int)>; S = int]':
D:/Workspace/ureact/include/ureact/ureact.hpp:2326:42: required from 'ureact::v0::observer ureact::v0::observe(ureact::v0::signal<R>&&, in_f&&) [with in_f = main()::<lambda(int, int)>; S = int]'
D:\Workspace\ureact\tests\src\playground\main.cpp:22:61: required from here
D:/Workspace/ureact/include/ureact/ureact.hpp:2289:39: error: no type named 'type' in 'struct std::invoke_result<main()::<lambda(int, int)>, int>'usingnode_t = std::conditional_t<std::is_same_v<void, R>,
^~~
It seems that I need a proper compile-time diagnostic to blame the user for incorrect usage, and give him a hint to fix it. std::is_invocable to the resque.
The text was updated successfully, but these errors were encountered:
Description
I made a mistake with passing 2 args lambda to observe a single signal.
I received the following error message:
It seems that I need a proper compile-time diagnostic to blame the user for incorrect usage, and give him a hint to fix it.
std::is_invocable to the resque.
The text was updated successfully, but these errors were encountered: