Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

5
  • 2
    Would a helper friend class bother you less than a helper function? Commented Dec 12, 2022 at 14:43
  • 2
    FWIW I'd just drop the static_assert into one of the constructors. If a constructor is not available I'd place it the main function that accesses the member variable (or closest to it's first logical access). Commented Dec 12, 2022 at 15:15
  • 2
    Why lpfilter must be private static field of test class? IMO simply can be some global constant in anonymous namespace in cpp file.
    – Marek R
    Commented Dec 12, 2022 at 15:24
  • @MarekR: Here, that would probably be an improvement, but there are other reasons (like type completeness) to have a separate definition of what really should be a static data member. Commented Dec 12, 2022 at 19:23
  • Helper friend class does bother me less. Constructors are currently in the header, but could be moved. Type completeness is what I was going for, but static global constant in the cpp is what I would do in C, and will work.
    – rsaxvc
    Commented Dec 13, 2022 at 20:32