STL_examples.cpp
TEST(copy, ExampleOne) {
    const std::vector<int> from{1,2,3,4,5};
    std::vector<int> to;
    to.reserve(from.size());
    std::copy(from.cbegin(), from.cend(), std::back_inserter(to));
    EXPECT_EQ(from, to);
}
// Note that copy_n() also exists that takes in another
// parameter to copy only the first n elements.
Note that copy_n() also exists that takes in another
parameter to copy only the first n elements.
Note that copy_n () also exists that takes in another parameter to copy only the first n elements .
TEST(copy, ExampleOne) {
    const std::vector<int> from{1,2,3,4,5};
    std::vector<int> to;
    to.reserve(from.size());
    std::copy(from.cbegin(), from.cend(), std::back_inserter(to));
    EXPECT_EQ(from, to);
}
TEST ( copy , ExampleOne ) { const std :: vector < int > from { 1 , 2 , 3 , 4 , 5 } ; std :: vector < int > to ; to . reserve ( from . size ( ) ) ; std :: copy ( from . cbegin ( ) , from . cend ( ) , std :: back_inserter ( to ) ) ; EXPECT_EQ ( from , to ) ; }
Note that copy_n() also exists that takes in another
parameter to copy only the first n elements.
Note that copy_n () also exists that takes in another parameter to copy only the first n elements .