test/deed_test.cpp
// Types that are noexcept movable and copyable can be put into a std::vector.
// Note that types that are copyable and movable with exception cannot be put
// in a std::vector.
Types that are noexcept movable and copyable can be put into a std::vector.
Note that types that are copyable and movable with exception cannot be put
in a std::vector.
Types that are noexcept movable and copyable can be put into a std :: vector . Note that types that are copyable and movable with exception cannot be put in a std :: vector .
TEST(Deed, NoExceptMoveVectorCompatible) {
  std::vector<TestObject> objects;
  objects.emplace_back(0);
  std::vector<Deed<TestObject>> deeds;
  deeds.emplace_back(&objects[0]);
  size_t initial_capacity = objects.capacity();
  size_t i = 1;
  while (objects.capacity() <= initial_capacity) {
    objects.emplace_back(i++);
    deeds.emplace_back(&objects.back());
  }
  for (i = 0; i < objects.size(); ++i) {
    EXPECT_EQ(deeds[i].get(), &objects[i]);
    EXPECT_EQ(deeds[i]->value, i);
  }
}
TEST ( Deed , NoExceptMoveVectorCompatible ) { std :: vector < TestObject > objects ; objects . emplace_back ( 0 ) ; std :: vector < Deed < TestObject > > deeds ; deeds . emplace_back ( & objects [ 0 ] ) ; size_t initial_capacity = objects . capacity ( ) ; size_t i = 1 ; while ( objects . capacity ( ) <= initial_capacity ) { objects . emplace_back ( i ++ ) ; deeds . emplace_back ( & objects . back ( ) ) ; } for ( i = 0 ; i < objects . size ( ) ; ++ i ) { EXPECT_EQ ( deeds [ i ] . get ( ) , & objects [ i ] ) ; EXPECT_EQ ( deeds [ i ] -> value , i ) ; } }
Types that are noexcept movable and copyable can be put into a std::vector.
Types that are noexcept movable and copyable can be put into a std :: vector .