Question: A template class Set is defined as follows. What is the correct program code to implement the getSize() member function? 9 template 0 class
A template class Set is defined as follows. What is the correct program code to implement the getSize() member function? 9 template 0 class Set { 1 public: 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 20 Set (T[], int); // default constructor Set (const Set&); // copy constructor ~Set(); // destructor int getSize() const; // return size // assignment operator const Set & operator= (const Set& ); // equality operator bool operator==(const Set& ) const; // inequality operator; returns opposite of == bool operator !=(const Set&) const; // subscript operator for non-const objects T& operator[] int ); // subscript operator for const objects T operator [] int) const; private: int size; // set size T *ptr; // pointer to first element of set operator O a template T Set::getSize() const { } O b. template return size; T Set getSize() const { } return size; O c. template int Set::getSize() const { return size; } O d. template } int Set getSize() const { return size;
Step by Step Solution
3.33 Rating (156 Votes )
There are 3 Steps involved in it
The detailed answer for the above question is provided below An... View full answer
Get step-by-step solutions from verified subject matter experts
