from_json for non default constructible class with dependency injection #1819
Labels
kind: question
solution: proposed fix
a fix for the issue has been proposed and waits for confirmation
state: stale
the issue has not been updated in a while and will be closed automatically soon unless it is updated
I have a class without a non default constructor like this:
ContextData
is a class that encapsulates dependencies, i.e., data I wish to shared between classes. In mymain()
, I would create a newContextData
object based on data from, say, a configuration file, and pass it around to classes that need this data.Is there a way to implement
from_json()
forSomeStruct
? I saw the example in the demo for a move constructible type, but I don't understand how I can capture additional data needed by the constructor of my class that is not coming from thejson
object argument tofrom_json()
.The text was updated successfully, but these errors were encountered: