Skip to content

Instantly share code, notes, and snippets.

@gattonero1052
Created June 23, 2020 19:22
Show Gist options
  • Save gattonero1052/d896dc47dba5be84b70d896a1c4be4c3 to your computer and use it in GitHub Desktop.
Save gattonero1052/d896dc47dba5be84b70d896a1c4be4c3 to your computer and use it in GitHub Desktop.
#include <iostream>
#include <string>
#include <vector>
using namespace::std;
class B{
};
class A{
public:
int x;
B &b;
A(int x,B &b):x{x},b{b}{}
};
int main()
{
B b;
A a1{1,b}, a2{2,b};
vector<A> va, vb;
va.push_back(a1);
vb.push_back(a2);
va.insert(std::end(va), std::begin(vb), std::end(vb));
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment