Created
February 10, 2014 03:50
-
-
Save jefftrull/8910059 to your computer and use it in GitHub Desktop.
queue<shared_ptr<SimpleStruct>> is not nothrow move constructible
This file contains hidden or 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 <queue> | |
#include <memory> | |
struct Foo { | |
int i; | |
}; | |
using namespace std; | |
static_assert(is_nothrow_move_constructible<shared_ptr<Foo>>::value, | |
"Shared pointer is not move constructible"); | |
static_assert(is_nothrow_move_constructible<queue<shared_ptr<Foo>>>::value, | |
"queue of shared pointers is not move constructible"); | |
int main() {} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Looks like the default underlying container deque<> is not, but if you supply a list<> as the second template parameter it will work.