Why it can't complile when I write this in a helper function, which return type is vector<TreeNode *>:
return vector<TreeNode *> (1, NULL);
I can't understand this reminder:
required from 'std::vector<_Tp, _Alloc>::vector(_InputIterator, _InputIterator, const allocator_type&) [with _InputIterator = int; _Tp = TreeNode*; _Alloc = std::allocator<TreeNode*>; std::vector<_Tp, _Alloc>::allocator_type = std::allocator<TreeNode*>]'
I write this before in another problem and it compiles:
vector<vector<int> > f(m, vector<int> (n, 0));
I don't know what's difference between these two codes.