I am trying to allocate a vector during the default constructor of an object I have.
What I am trying to allocate is this:
What I want is a vector of size 4 to be allocated with each slot containing an empty 'bin_index' object.
I have a default constructor for bin_index to set values to 0 but it is still not working. This is what I have tried so far:
I know you can allocate a vector initially just like an array but I am having some trouble with the syntax when it includes objects. I am allocating it initially because I am implementing a hash table so I need a vector instead of an array.
//try number 1
//try number 2
//try number 3
Here is the basic error message I keep getting:
error: no match for call to ‘(std::vector<bin_index, std::allocator<bin_index> >) (int, bin_index&)’