Skip to content

Instantly share code, notes, and snippets.

View marijanp's full-sized avatar

Marijan Petričević marijanp

View GitHub Profile
@marijanp
marijanp / cpp_notes.md
Last active January 26, 2022 11:31
C++ notes

Dealing with raw pointers

int facory_function(Type *t);

int main (int argc, char *argv[]) {
  const std::unique_ptr<Type> t_ptr{ [] {
    Type *t = nullptr;
    if (factory_function(t)) {
      return t;
 }