What is empty pair base class

Submitted 3 years, 4 months ago
Ticket #327
Views 250
Language/Framework Python
Priority Low
Status Closed

The purpose of empty pair and base class

Submitted on Dec 18, 20
add a comment

1 Answer

Verified

template<typename, typename> class __pair_base
  {
    template<typename T, typename U> friend struct pair;
    __pair_base() = default;
    ~__pair_base() = default;
    __pair_base(const __pair_base&) = default;
    __pair_base& operator=(const __pair_base&) = delete;
  };

template<typename T, typename U>
  struct pair
  : private __pair_base<T, U>
{ /* never uses __pair_base */ };

Submitted 3 years, 4 months ago


Latest Blogs