Search
 
SCRIPT & CODE EXAMPLE
 

CPP

make_move_iterator

#include <iostream>
#include <iterator>
#include <string>
#include <vector>

int main() 
{
    std::vector<std::string> v1{"a", "b", "c", "d", "e"};
    std::vector<std::string> v2(std::make_move_iterator(v1.begin()),
                                std::make_move_iterator(v1.end()));

    std::cout << "v1 size " << v1.size() << '
';
    std::cout << "v1: ";
    for (const auto& s : v1) std::cout << s << " - ";
    std::cout << '
';

    std::cout << "v2 size " << v2.size() << '
';
    std::cout << "v2: ";
    for (const auto& s : v2) std::cout << s << " - ";
    std::cout << '
';
}
Comment

PREVIOUS NEXT
Code Example
Cpp :: ue4 bind function to button clicked c++ 
Cpp :: qt qchar to lower 
Cpp :: c++ converting centimeters to meters 
Cpp :: watermelon codeforces solution 
Cpp :: c++ writing to file 
Cpp :: what are various sections of process 
Cpp :: cuda kernel extern shared memory 
Cpp :: tostring c++ 
Cpp :: average of a matrix c++ 
Cpp :: qt messagebox 
Cpp :: return the index where maximum element in a vector 
Cpp :: custom comparator in set of struct 
Cpp :: do you need inline for template in C++ 
Cpp :: cannot find -lsqlite3 C++ compiler error 
Cpp :: __lg(x) in c++ 
Cpp :: c++ std::copy to cout 
Cpp :: how to print with the bool value in cpp 
Cpp :: how to know in flutter if signin with user completed in firebase 
Cpp :: declare dynamic array c++ 
Cpp :: extends c++ 
Cpp :: how to get command arguments c++ 
Cpp :: what is the difference between i++ and ++ i ? 
Cpp :: queue implementation using linked list in cpp 
Cpp :: conditional operator in cpp 
Cpp :: C++ do...while Loop 
Cpp :: random number cpp 
Cpp :: c++ cin operator 
Cpp :: max of a vector c++ 
Cpp :: how to pass function as a parameter in c++ 
Cpp :: how to do sets in cpp 
ADD CONTENT
Topic
Content
Source link
Name
9+6 =