Hacker News new | ask | show | jobs
by jcelerier 1453 days ago
The concept version here would look like:

    template<typename T>
    concept WesternishName = requires (T t) { 
      { t.firstName } -> convertible_to<string>; 
      { t.lastName } -> convertible_to<string>;
    };

    auto concatenate(WesternishName auto t) { return t.firstName + " " + t.lastName; }