[DiscordArchive] at that point the functions you call should just hand you the resources and it'd be the same as AddS
[DiscordArchive] at that point the functions you call should just hand you the resources and it'd be the same as AddS
Archived author: <o> • Posted: 2022-09-11T17:52:42.660000+00:00
Original source
because the variables you're declaring don't need to initialize, and since your function just asks for the table there's nobody asking for them
Archived author: Sovak • Posted: 2022-09-11T17:53:17.477000+00:00
Original source
They are global ctors, they are initialized first and LeakTests is called once at runtime
![[Image: unknown.png?ex=690c37f3&is=690ae673&hm=6...ae13da0d6&]](https://cdn.discordapp.com/attachments/376074396915335170/1018580166143905813/unknown.png?ex=690c37f3&is=690ae673&hm=65fe9f38f9a9edfe631aefc6416a789a11d5b84bbe9b92e4dbafe86ae13da0d6&)
Archived author: Sovak • Posted: 2022-09-11T17:53:55.967000+00:00
Original source
And GetTests will be initialized, because it must initialize on first access
![[Image: unknown.png?ex=690c37f3&is=690ae673&hm=6...ae13da0d6&]](https://cdn.discordapp.com/attachments/376074396915335170/1018580166143905813/unknown.png?ex=690c37f3&is=690ae673&hm=65fe9f38f9a9edfe631aefc6416a789a11d5b84bbe9b92e4dbafe86ae13da0d6&)
Archived author: <o> • Posted: 2022-09-11T17:56:38.973000+00:00
Original source
that just fixes init order fiasco, but there's an additional issue with it. trying to find the section in the standard
Archived author: <o> • Posted: 2022-09-11T18:03:16.415000+00:00
Original source
deferred dynamic initialization
Archived author: <o> • Posted: 2022-09-11T18:04:29.313000+00:00
Original source
but it's been a while, it's possible you can find a way to work around that, or just refer to some other testing library
Archived author: <o> • Posted: 2022-09-11T18:05:27.976000+00:00
Original source
you can see this article to make sure, it's possible i've just forgotten why I gave up on it <https://en.cppreference.com/w/cpp/language/initialization>
Archived author: Sovak • Posted: 2022-09-11T18:08:25.769000+00:00
Original source
Woudlnt that be a no-issue? "However, as long as anything from a translation unit is odr-used, all non-local variables whose initialization or destruction has side effects will be initialized even if they are not used in the program."
Archived author: Sovak • Posted: 2022-09-11T18:08:58.018000+00:00
Original source
If I call LeakTests, everything needs to be initialized, if I understood that correctly
Archived author: <o> • Posted: 2022-09-11T18:09:17.218000+00:00
Original source
yeah, i think so, but you'll need it in every tu