Modernes C++ programmieren

Okt 23, 2024

lst-0253-godb.cpp

//#(execute) c++; compiler:g132; options:-O3 -std=c++23; libs:-
// https://godbolt.org/z/Exh4PnMTE 
#include <string>
#include <string_view>
using std::string; using sview = std::string_view;

struct Person {
    string name_;
    int alter_;
    string ort_;

    Person(sview n = "N.N.", int a = 18, sview o = "Berlin")
      : name_(n), alter_(a), ort_(o) { }
};