« first day (4606 days earlier)      last day (328 days later) » 

3:54 AM
 
 
4 hours later…
7:42 AM
I got a non C++ question.

In c2x is there some way to perform impure variable initialization in global scope. For example, setup a pointer to a global logger?
 
8:42 AM
> impure variable initialization
I got an std just from reading that.
2
 
 
1 hour later…
9:50 AM
so basically instead of having a global variable to the logger, I guess C codes have to constantly call a getter that looks like
logger *get_logger()
{
  static atomic_bool initialized = 0;
  if (initialized == 0)
 
 
4 hours later…
2:16 PM
@Mikhail A dream to live by
@TelKitty Excuse me, but that's a whole fucking lot for a hobby
@Mikhail I think you can only initialize a global variable with a constant expression
I remember that I tried doing that 10 years ago, only to realize that C was really limited in what it could do in that area
It goes a lengths to not execute user code before main
 

« first day (4606 days earlier)      last day (328 days later) »