Skip to content

Conversation

@firewave
Copy link
Collaborator

No description provided.

@firewave
Copy link
Collaborator Author

This is also prevents simplecpp::preprocess() from throwing.

macros.insert(std::pair<TokenString,Macro>(macro.name(), macro));
try {
const Macro macro(lhs, rhs, dummy);
macros.insert(std::pair<TokenString,Macro>(macro.name(), macro));
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we use macros.emplace(macro.name(), macro); syntax nowadays or is a newer C++ needed for that?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See #596.

macros.insert(std::pair<TokenString,Macro>(macro.name(), macro));
} catch (const std::runtime_error& e) {
if (outputList) {
simplecpp::Output err = {
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I prefer that the = is removed here. We just want that the constructor is called. No initializer list + assignment stuff..

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will clean up as a whole in a follow-up.

{},
e.what()
};
outputList->push_back(std::move(err));
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we can't emplace_back ?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I only adjusted those when Clang-Tidy told us to.

Will adjust as a whole in a follow-up.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants