Remix.run Logo
AdieuToLogic 5 hours ago

There are a few problems with this post:

  1 - In C++, a struct is no different than a class
      other than a default scope of public instead of
      private.
  2 - The use of braces for property initialization
      in a constructor is malformed C++.
  3 - C++ is not C, as the author eventually concedes:

  At this point, my C developer spider senses are tingling: 
  is Response response; the culprit? It has to be, right? In 
  C, that's clear undefined behavior to read fields from 
  response: The C struct is not initialized.
In short, if the author employed C++ instead of trying to use C techniques, all they would have needed is a zero cost constructor definition such as:

  inline Response () : error (false), succeeded (false)
  {
    ;
  }