We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
The uml dumper extension seems to write empty brackets [] for unnamed arguments. Take a look at the following object tree:
[]
#include "di.hpp" #include "uml_dumper.hpp" struct MyLogger {}; struct App { App(MyLogger&) {} }; int main() { auto const injector = boost::di::make_injector<boost::di::extension::uml_dumper>(); auto app = injector.create<App>(); }
The uml dumper should print the following output (no empty brackets []):
@startuml uml_dumper.png "struct App" .. "struct MyLogger" @enduml
The uml dumper does write empty brackets:
@startuml uml_dumper.png "struct App" .. "struct MyLogger []" @enduml
Run the code from above.
The text was updated successfully, but these errors were encountered:
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
uml_dumper.hpp
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
(*(name*)(0))()
operator()
no_name
""
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.
n?
n
std::string
Sorry, something went wrong.
No branches or pull requests
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
The text was updated successfully, but these errors were encountered: