Skip to content

Conversation

@wthrowe
Copy link
Member

@wthrowe wthrowe commented Feb 27, 2023

Also includes two cleanup commits related to DataBox to avoid recompilations for a second PR touching DataBox.hpp.

Proposed changes

Upgrade instructions

Code review checklist

  • The code is documented and the documentation renders correctly. Run
    make doc to generate the documentation locally into BUILD_DIR/docs/html.
    Then open index.html.
  • The code follows the stylistic and code quality guidelines listed in the
    code review guide.
  • The PR lists upgrade instructions and is labeled bugfix or
    new feature if appropriate.

Further comments

@wthrowe
Copy link
Member Author

wthrowe commented Feb 27, 2023

Not sure what the best way to handle the build failures is. It seems that in this context DEBUG_STATIC_ASSERT is required to be followed by a semicolon in Debug mode and forbidden from being followed by a semicolon in Release mode.

* resolves base tags and converts subitems to full items.
*/
template <typename Tag, typename Box>
using real_tag =
Copy link
Member

Choose a reason for hiding this comment

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

If I understand what this is doing, in the type aliases in DataBox I have been calling the tags returned by this metafunction creation_tags. If so can we use that nomenclature?

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes, those appear to be the same thing. I will adopt that name.

* themselves, and an item and its subitems all depend on one another.
*/
template <typename Provider, typename Consumer, typename Box>
using tag_depends_on =
Copy link
Member

Choose a reason for hiding this comment

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

Not a change request, but I will probably get this backwards when I use/read it without looking up the documentation, as I was expecting the first template argument to be the Consumer tag that depends upon the Provider.

Copy link
Member Author

Choose a reason for hiding this comment

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

I copied the order from tt::is_a<Template, Type>, but std::is_base_of<Base, Derived> is the opposite, so yeah, not obvious which is better.

Copy link
Member

Choose a reason for hiding this comment

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

The choice on is_a is the same as is_base_of in my opinion. It is <generic, specific>. That is, the generic template in is_a plays a similar role to the generic base class in is_base_of. That's why the ordering is that way 🤷

Copy link
Member Author

Choose a reason for hiding this comment

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

The English is backward, though: "X is base of Y" and "Y is a X".

Copy link
Member

Choose a reason for hiding this comment

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

That's fair. I have no preference for what you want to do in this PR :) Just wanted to give context as to why I made is_a the way it is!

Copy link
Member

Choose a reason for hiding this comment

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

If neither of you have a preference, I would prefer to reverse the order of the template parameters

Copy link
Member

Choose a reason for hiding this comment

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

That's fine by me :)

@kidder
Copy link
Member

kidder commented Feb 27, 2023

Not sure what the best way to handle the build failures is. It seems that in this context DEBUG_STATIC_ASSERT is required to be followed by a semicolon in Debug mode and forbidden from being followed by a semicolon in Release mode.

Add a similar code block as we do for the false branch of ASSERT?

@wthrowe
Copy link
Member Author

wthrowe commented Feb 28, 2023

Right. Of course. Added a commit for that (at the beginning).

Did the rename without a fixup, because it was a find-replace rename. Waiting to see if anyone else wants to weigh in on argument ordering.

@wthrowe wthrowe changed the title Add db::real_tag and db::tag_depends_on metafunctions Add db::creation_tag and db::tag_depends_on metafunctions Feb 28, 2023
@kidder
Copy link
Member

kidder commented Feb 28, 2023

okay sounds good

wthrowe added 5 commits March 23, 2023 13:31
Avoids warnings about extra semicolons.
We haven't supported removing tags for a while.
This file seems to contain a fairly random set of things:
Tags::DataBox, db::const_item_type, and some internal DataBox helpers.
It should probably be split and reorganized, but that's a bigger
project.
@kidder kidder enabled auto-merge March 23, 2023 21:22
@kidder kidder merged commit 9b0f700 into sxs-collaboration:develop Mar 24, 2023
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.

3 participants