title: How to avoid repeating class name and template call in implementation?
body: <p>I find the code below terribly difficult to read, and I wrote it! Is there any to</p>
  
  <ol>
  <li>avoid calling template for each implemented member function</li>
  <li>avoid having <code>ClassName::member_function_name</code> for each implemented member function? I find Java DRYer in this regard. You don't repeat the class name everywhere.</li>
  </ol>
  
  <p>Thanks!</p>
  
  <pre><code>template &lt;class KeyType, class ObjectType&gt;
  class Vertex
  {
  private:
      KeyType key;
      const ObjectType* object;
  public:
      Vertex(const KeyType&amp; key, const ObjectType&amp; object);
      const KeyType getKey();
  };
  
  template &lt;class KeyType, class ObjectType&gt; 
  class Graph
  {
  private:
      map&lt;KeyType, Vertex&lt;KeyType, ObjectType&gt; &gt; vertexes;
  public:
      const Vertex&lt;KeyType, ObjectType&gt;&amp; createVertex(const KeyType&amp; key, const ObjectType&amp; object);
  };
  
  template &lt;class KeyType, class ObjectType&gt;
  Vertex&lt;KeyType, ObjectType&gt;::Vertex(const KeyType&amp; objectKey, const ObjectType&amp; newObject)
  {
      key = objectKey;
      object = &amp;newObject;
  };
  
  template &lt;class KeyType, class ObjectType&gt;
  const KeyType Vertex&lt;KeyType, ObjectType&gt;::getKey()
  {
      return key;
  };
  
  template &lt;class KeyType, class ObjectType&gt;
  const Vertex&lt;KeyType, ObjectType&gt;&amp; Graph&lt;KeyType, ObjectType&gt;::createVertex(const KeyType&amp; key, const ObjectType&amp; object)
  {
      Vertex&lt;KeyType, ObjectType&gt; *vertex = new Vertex&lt;KeyType, ObjectType&gt;(key, object);
      vertexes.insert(make_pair(vertex-&gt;getKey(), *vertex));
      return *vertex;
  };
  </code></pre>