STL_examples.cpp
TEST(generate, ExampleOne) {
    const auto randomNumber = []()->double{
        return std::rand();
    };
    std::vector<double> v(5);
    std::generate(v.begin(), v.end(), randomNumber);
}
// Note that generate_n also exists.
Note that generate_n also exists.
Note that generate_n also exists .
TEST(generate, ExampleOne) {
    const auto randomNumber = []()->double{
        return std::rand();
    };
    std::vector<double> v(5);
    std::generate(v.begin(), v.end(), randomNumber);
}
TEST ( generate , ExampleOne ) { const auto randomNumber = [ ] ( ) -> double { return std :: rand ( ) ; } ; std :: vector < double > v ( 5 ) ; std :: generate ( v . begin ( ) , v . end ( ) , randomNumber ) ; }
Note that generate_n also exists.
Note that generate_n also exists .