title: Can we increase the re-usability of this key-oriented access-protection pattern?
body: <p>Can we increase the re-usability for <a href="https://stackoverflow.com/questions/3220009/is-this-key-oriented-access-protection-pattern-a-known-idiom">this key-oriented access-protection pattern</a>:</p>
  
  <pre><code>class SomeKey { 
      friend class Foo;
      // more friends... ?
      SomeKey() {} 
      // possibly non-copyable too
  };
  
  class Bar {
  public:
      void protectedMethod(SomeKey); // only friends of SomeKey have access
  };
  </code></pre>
  
  <p>To avoid continued misunderstandings, this pattern is different from the <a href="http://www.drdobbs.com/184402053" rel="noreferrer">Attorney-Client</a> idiom:</p>
  
  <ul>
  <li>It can be more concise than Attorney-Client (as it doesn't involve proxying through a third class)</li>
  <li>It can allow delegation of access rights</li>
  <li>... but its also more intrusive on the original class (one dummy parameter per method) </li>
  </ul>
  
  <p><em>(A side-discussion developed in <a href="https://stackoverflow.com/questions/3324248/how-to-name-this-key-oriented-access-protection-pattern/3324741">this question</a>, thus i'm opening this question.)</em></p>