0

Ive got this constructor here in which I have to set these buckets to nullptr

template<class T>SetType<T>::SetType() {
    // Create an array of forward_lists and initially set to an empty forward_list

    buckets = new forward_list<T>[DEFAULT_BUCKETS];
       // buckets = nullptr;
    for (int i = 0; i < DEFAULT_BUCKETS; i++)
    {
        buckets[i] = nullptr;
    }
}

This is how the variable "buckets" is declared in the header file

private:
    forward_list<T>* buckets; // An array of forward_list's
                                // (each index is a foward_list)

enter image description here

Omar Aziz
  • 19
  • 4

0 Answers0