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
{{ message }}
Repository navigation
How do i include a vector of pointers in my json? #1997
I have the class LogHistory::LogEntry (class inside of another class) and LogHistory provides a static getter for an std::vector<LogEntry*>*
All fine and good for normal iterating, but how do i put this thing into a json?
I tried the to_json(json& j, LogEntry& le) conversion method, but i just get "no suitable conversion method found"
Both of these two get underlined red with "no suitable conversion method found"
Activity
Leonetienne commentedon Mar 19, 2020
It does work when i use a conversion operation, eg
but that obviously does not work with the vector :(
nlohmann commentedon Mar 19, 2020
You must define the
to_jsonmethod as a free function (no static function) in the same namespace asLogHistory.