Skip to main content
added 23 characters in body
Source Link
Loki Astari
  • 97.7k
  • 5
  • 126
  • 341
owner_ptr& operator=(const owner_ptr<T[]>& rhs)
{
    private_pass(rhs.get_ownership());
    return *this;
}

void pass(T* ptr = NULL)
{
    private_pass(ptr);
}
private:
void private_pass(T* ptr)
{
    if (p != ptr)
    {
        T* tmp = p;
        p = ptr;
        delete[] tmp;
    }
}
owner_ptr& operator=(const owner_ptr<T[]>& rhs)
{
    private_pass(rhs.get_ownership());
}

void pass(T* ptr = NULL)
{
    private_pass(ptr);
}
private:
void private_pass(T* ptr)
{
    if (p != ptr)
    {
        T* tmp = p;
        p = ptr;
        delete[] tmp;
    }
}
owner_ptr& operator=(const owner_ptr<T[]>& rhs)
{
    private_pass(rhs.get_ownership());
    return *this;
}

void pass(T* ptr = NULL)
{
    private_pass(ptr);
}
private:
void private_pass(T* ptr)
{
    if (p != ptr)
    {
        T* tmp = p;
        p = ptr;
        delete[] tmp;
    }
}
deleted 1 character in body
Source Link
Loki Astari
  • 97.7k
  • 5
  • 126
  • 341
T* get_ownership() throwsthrow();
T* get_ownership() throws();
T* get_ownership() throw();
added 164 characters in body
Source Link
Loki Astari
  • 97.7k
  • 5
  • 126
  • 341

###No Throwing methods

Since the get_ownership() method is guaranteed not to throw you should probably mark it as such.

T* get_ownership() throws();

###Questions:

###Questions:

###No Throwing methods

Since the get_ownership() method is guaranteed not to throw you should probably mark it as such.

T* get_ownership() throws();

###Questions:

Source Link
Loki Astari
  • 97.7k
  • 5
  • 126
  • 341
Loading