Last active
August 29, 2015 14:26
-
-
Save artemkin/f9ed3bff0191af3c396c to your computer and use it in GitHub Desktop.
Can't move from initializer_list
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
#include <memory> | |
#include <vector> | |
#include <initializer_list> | |
#include <iterator> | |
struct Item | |
{ | |
virtual ~Item() {} | |
}; | |
using ItemPtr = std::unique_ptr<Item>; | |
void f(std::initializer_list<ItemPtr> i_items) | |
{ | |
std::vector<ItemPtr> items( | |
std::make_move_iterator(i_items.begin()), | |
std::make_move_iterator(i_items.end()) | |
); | |
} | |
int main() { | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment