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'm trying to compile a basic example, very close to what's presented in the examples folder on Windows w/ MSVC '17:
struct model
{
int value = 0;
};
struct increment_action {};
struct decrement_action {};
struct reset_action {
int new_value = 0;
};
using action = std::variant<increment_action, decrement_action, reset_action>;
auto store = lager::make_store<action >(
model{}, lager::with_manual_event_loop{});
This basic store init fails with error:
Severity Code Description Project File Line Suppression State Details
Error C3200 'lager::detail::reader_node<T>': invalid template argument for template parameter 'Base', expected a class template redacted redacted\lib\lager\store.hpp 40
I'm not entirely sure what the error is but store_node_base seems to have issue deducing the types it needs correctly.
The text was updated successfully, but these errors were encountered:
I don't think this is a MSVC issue. You don't have an update function.
Try adding:
model update(model m, action a) { return m; }
Edit
Note that, as far as I can tell, there isn't necessarily a location in the lager doc that specifies explicitly that, by default, the make_store function expects to see an update function of an appropriate signature in order to work. However, it does show an example of the with_reducer enhancer here. This latter enhancer allow for more flexibility in the definition of your update function. In particular, it can be a class.
@TheCoconutChef I forgot to add that code in my original post but I did have that update function. I just tested again with the update function and confirmed I am getting the same error. I read on another post people having better luck with C++20 so I switched to that and am now facing the same issue described here: #126 (comment)
I'm trying to compile a basic example, very close to what's presented in the examples folder on Windows w/ MSVC '17:
This basic store init fails with error:
I'm not entirely sure what the error is but
store_node_base
seems to have issue deducing the types it needs correctly.The text was updated successfully, but these errors were encountered: