title: How to make inherited base classes use a common variable
body: <p>Let's say I want to create an interface for</p>
  
  <ol>
  <li><code>Item</code>s that have content that can be read.</li>
  <li><code>Item</code>s that have content that can be written.</li>
  <li><code>Item</code>s that have content that can be read a/o written</li>
  </ol>
  
  <p>However I don't want to create 3 abstract classes as I may want to pass an <code>Item</code>, that is read-writable to a function which only accepts readable items.</p>
  
  <p>e.g. you can only read a <code>Book</code>, so <code>Book</code> would inherit <code>Readable</code>, while a <code>Note</code> can be read and written, thus it would inherit <code>ReadWritable</code>.</p>
  
  <p>So now I can create function like that:</p>
  
  <pre><code>std::string read(Readable&amp; readable) const
  </code></pre>
  
  <p>or </p>
  
  <pre><code>void take_a_note(Writable&amp; writable)
  </code></pre>
  
  <hr>
  
  <p>I have this <code>Readable</code> abstract class</p>
  
  <pre><code>template &lt;typename ReadableType&gt;
  class Readable
  {
  public:
      Readable(const ReadableType content);
      virtual ~Readable(void);
      virtual auto content(void) const noexcept -&gt; const ReadableType&amp;&amp;;
  
  private:
      const ReadableType _content;
  };
  </code></pre>
  
  <p>And a <code>Writable</code> abstract class</p>
  
  <pre><code>template &lt;typename WritableType&gt;
  class Writable
  {
  public:
      Writable(void);
      virtual ~Writable(void);
      virtual void content(WritableType&amp;&amp; content) noexcept;
  
  private:
      WritableType _content;
  };
  </code></pre>
  
  <p>But now I want to create a an abstract class which combines those functionalities, called <code>ReadWritable</code></p>
  
  <pre><code>template &lt;typename ReadWritableType&gt;
  class ReadWritable: public Readable&lt;ReadWritableType&gt;, public Writable&lt;ReadWritableType&gt;
  {
  public:
      ReadWritable(ReadWritableType content);
      virtual ~ReadWritable(void);
      using Writable&lt;ReadWritableType&gt;::content;
      using Readable&lt;ReadWritableType&gt;::content;
  };
  </code></pre>
  
  <p>This is where the problem is, as <code>content(WritableType&amp;&amp; content)</code> uses <code>Writable::_content</code>, while <code>content(void)</code> uses <code>Readable::_content</code>.</p>
  
  <p>How I can make them use the same <code>_content</code> data member. And if I can do that, is there a way to delete the other one?</p>
  
  <hr>
  
  <p>Or is my complete approach wrong? I'm open for every opinion.</p>