Open dagophil opened 4 years ago
The cause of the problem seems to be this line in uml_dumper.hpp
:
https://github.com/boost-experimental/di/blob/cb065b20bf846642c229485492a9e0af66ef8748/extension/include/boost/di/extension/policies/uml_dumper.hpp#L43-L44
For unnamed arguments, the code (*(name*)(0))()
calls operator()
of the no_name
placeholder, which returns an empty string ""
:
https://github.com/boost-experimental/di/blob/cb065b20bf846642c229485492a9e0af66ef8748/include/boost/di.hpp#L292-L294
This means that the code in uml_dumper.hpp
resolves to something like this:
char const* const n = "";
[...] << (n ? std::string(" [") + n + std::string("]") : "") << [...]
The n?
checks whether n
is a nullptr. I think here, one must instead check that n
is not empty. One could, for example, copy n
into some std::string
.
The uml dumper extension seems to write empty brackets
[]
for unnamed arguments. Take a look at the following object tree:Expected Behavior
The uml dumper should print the following output (no empty brackets
[]
):Actual Behavior
The uml dumper does write empty brackets:
Steps to Reproduce the Problem
Run the code from above.
Specifications