Modernes C++ programmieren

Okt 23, 2024

lst-0253-book.cpp

// 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) { }
};