Lets say we have the following class:

```
class Foo
{
public:
    Foo() { _bar=new Bar };
    Foo(const Foo &right) { _bar=new Bar(right.bar); };
    Foo(Foo &&right) { _bar=right._bar;  right.bar=new Bar(); };

    ~Foo() { delete _bar; }

    Foo &operator=(const Foo &right) { _bar->opertor=(right.bar); return *this;}
    Foo &operator=(Foo &&right) { std::swap(_bar, right._bar); return *this;}

    void func() { _bar->test=1 };

private:
    Bar *_bar;
};

```

is it legitimate to alter it to the following and expect the end user to know that after the move is performed that the rvalue is no longer valid (in that calling anything other than the assignment operator could crash)?

```
class Foo
{
public:
    Foo() { _bar=new Bar };
    Foo(const Foo &right) { _bar=new Bar(right.bar); };
    Foo(Foo &&right) { _bar=right._bar;  right.bar=nullptr; };

    ~Foo() { if(_bar != nullptr) delete _bar; }

    Foo &operator=(const Foo &right) 
    { 
         if(_bar == nullptr) 
             _bar=new Bar();
         _bar->opertor=(right.bar); 
         return *this;
    }

    Foo &operator=(Foo &&right)
    {
        if(_bar != nullptr)
            delete _bar;  
        _bar=right._bar; 
        right._bar=nullptr; 
        return *this;
    }

    void func() { _bar->test=1 };

private:
    Bar *_bar;
};

```

my concern comes from the fact that func (and all other functions in the class) assume that \_bar exists.