I want the DI framework to find out the dependency graph problem at compile time if possible. However, in the default configuration, Boost.DI just value initializes ints, bools and other fundamental types. I want these to be explicitly supplied via instance binding, and I want it to be enforced.
I tried policies, but I couldn't figure out how to do what I want. The constructible policy seems only applicable to the arguments to the constructor. int has no constructor, and therefore is always allowed by the policy. I also tried to static assert the arity > 0, but then all explicitly bound ints fail the policy too.
I'm stumped. How to write such a policy? And even better, can Boost.DI have an easier way to enforce strictness?
I want the DI framework to find out the dependency graph problem at compile time if possible. However, in the default configuration, Boost.DI just value initializes
int
s,bool
s and other fundamental types. I want these to be explicitly supplied via instance binding, and I want it to be enforced.I tried policies, but I couldn't figure out how to do what I want. The
constructible
policy seems only applicable to the arguments to the constructor.int
has no constructor, and therefore is always allowed by the policy. I also tried to static assert the arity > 0, but then all explicitly boundint
s fail the policy too.I'm stumped. How to write such a policy? And even better, can Boost.DI have an easier way to enforce strictness?