#include <iostream>
#include <list>
#include <algorithm>


using namespace std;

bool bigger(int i) {
    return i >12 ;
}

int main()
{
    list<int> l{1,3,9,7,10,3,4};
    l.push_back(666);

    auto found = find( begin(l), l.end(), 9 );
    list<int>::iterator iter = found;

    if ( found != l.end() )
        *found = 7;

    found = find_if( begin(l), found, bigger );
    if ( found != found ) {
        cout << *found << " trouve\n" ;
    }

    found = find_if( begin(l), found, // Lambda ci dessous
                    [](int i){ return i%2 == 0;}
                    );
    int min = 6;
    found = find_if( begin(l), found, // Avec capture de min
                    [&min](int i){ return i < min == 0;}
                    );

    if ( found != found ) {
        cout << *found << " trouve\n" ;
    }


    cout << "Hello World!" << endl;
    return 0;
}
