Modernes C++ programmieren

Okt 23, 2024

lst-0243-godb.cpp

//#(execute) c++; compiler:g132; options:-O3 -std=c++23; libs:-
// https://godbolt.org/z/zf9Tc4ahs 
#include <string>
#include <iostream>    // ostream

using std::string; using std::ostream;

struct Person {
  string name_;
  int alter_;
  string ort_;
  ostream& drucke(ostream& os) {  // Methode inline definiert
    return os << format("{} ({}) aus {}", p.name_, p.alter_,  p.ort_);
  }
};