Modernes C++ programmieren

Okt 23, 2024

lst-0698-godb.cpp

//#(compile) c++; compiler:g132; options:-O3 -std=c++23; libs:-
// https://godbolt.org/z/nj14e6Wq4 
#include <set>
#include <iostream>
int main() {
    std::set<int> numbers{ 10, 20, 90 };
    auto nein = numbers.find(30);
    if(nein == numbers.end()) { std::cout << "nicht da.\n"; }
    auto ja = numbers.find(20);
    if(ja != numbers.end()) { std::cout << *ja << '\n'; }
}