Timeline for scoping static_assert for class static member array
Current License: CC BY-SA 4.0
7 events
when toggle format | what | by | license | comment | |
---|---|---|---|---|---|
Dec 13, 2022 at 20:32 | comment | added | rsaxvc | 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. | |
Dec 12, 2022 at 19:23 | comment | added | Davis Herring | @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. | |
Dec 12, 2022 at 15:24 | comment | added | Marek R |
Why lpfilter must be private static field of test class? IMO simply can be some global constant in anonymous namespace in cpp file.
|
|
Dec 12, 2022 at 15:15 | comment | added | Captain Obvlious |
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).
|
|
Dec 12, 2022 at 15:03 | history | edited | wohlstad | CC BY-SA 4.0 |
added 8 characters in body
|
Dec 12, 2022 at 14:43 | comment | added | Igor Tandetnik | Would a helper friend class bother you less than a helper function? | |
Dec 12, 2022 at 14:31 | history | asked | rsaxvc | CC BY-SA 4.0 |