#include <vector>
#include <iostream>
using namespace std;
struct vec2i{int x;int y;};
struct t_quad{vec2i pos;vec2i size;t_quad(){}};
int main() {
vector<t_quad> arr;
arr.push_back({{0,0},{10,20}});
cout<<arr.size();
return 0;
}
I2luY2x1ZGUgPHZlY3Rvcj4KI2luY2x1ZGUgPGlvc3RyZWFtPgp1c2luZyBuYW1lc3BhY2Ugc3RkOwoKc3RydWN0IHZlYzJpe2ludCB4O2ludCB5O307CnN0cnVjdCB0X3F1YWR7dmVjMmkgcG9zO3ZlYzJpIHNpemU7dF9xdWFkKCl7fX07CgppbnQgbWFpbigpIHsKICB2ZWN0b3I8dF9xdWFkPiBhcnI7CiAgYXJyLnB1c2hfYmFjayh7ezAsMH0sezEwLDIwfX0pOwogIGNvdXQ8PGFyci5zaXplKCk7CiAgcmV0dXJuIDA7Cn0=
prog.cpp: In function ‘int main()’:
prog.cpp:10:32: error: no matching function for call to ‘std::vector<t_quad>::push_back(<brace-enclosed initializer list>)’
arr.push_back({{0,0},{10,20}});
^
prog.cpp:10:32: note: candidates are:
In file included from /usr/include/c++/4.8/vector:64:0,
from prog.cpp:1:
/usr/include/c++/4.8/bits/stl_vector.h:901:7: note: void std::vector<_Tp, _Alloc>::push_back(const value_type&) [with _Tp = t_quad; _Alloc = std::allocator<t_quad>; std::vector<_Tp, _Alloc>::value_type = t_quad]
push_back(const value_type& __x)
^
/usr/include/c++/4.8/bits/stl_vector.h:901:7: note: no known conversion for argument 1 from ‘<brace-enclosed initializer list>’ to ‘const value_type& {aka const t_quad&}’
/usr/include/c++/4.8/bits/stl_vector.h:919:7: note: void std::vector<_Tp, _Alloc>::push_back(std::vector<_Tp, _Alloc>::value_type&&) [with _Tp = t_quad; _Alloc = std::allocator<t_quad>; std::vector<_Tp, _Alloc>::value_type = t_quad]
push_back(value_type&& __x)
^
/usr/include/c++/4.8/bits/stl_vector.h:919:7: note: no known conversion for argument 1 from ‘<brace-enclosed initializer list>’ to ‘std::vector<t_quad>::value_type&& {aka t_quad&&}’