title: BGL: specialization of template in different namespace
body: <p>I am creating a graph by BGL, and would like to combine bundled properties with <code>vertex_index_t</code> as the <code>VertexProperty</code> of the graph is <code>listS</code>.</p>
  
  <p>I used the method from <a href="https://stackoverflow.com/questions/11336723/bgl-dijkstra-shortest-path-algorithm-method-does-not-accept-my-color-map-exterio/19717509#19717509">BGL dijkstra_shortest_path algorithm method does not accept my color map exterior property</a> , however, I end up with <code>specialization of template in different namespace</code> error.</p>
  
  <pre><code>#include &lt;boost/graph/adjacency_list.hpp&gt;
  
  namespace MyNameSpace {
  
  using namespace boost;
  
  struct VertexP {
      std::string name;
      unsigned int id;
  };
  
  typedef adjacency_list&lt;vecS, listS, bidirectionalS, VertexP&gt; Graph;
  
  class VertexIndexMap {
  public:
      typedef boost::readable_property_map_tag category;
      typedef size_t  value_type;
      typedef value_type reference;
      typedef Graph::vertex_descriptor key_type;
  
      VertexIndexMap(const Graph&amp; g): _g(&amp;g) {}
  
      const Graph * _g;
  };
  
  template&lt;&gt;
  struct property_map&lt;Graph, vertex_index_t &gt; {
      typedef VertexIndexMap const_type;
  };
  
  }
  </code></pre>
  
  <p>I tried the following code, but not work.</p>
  
  <pre><code>namespace MyNameSpace {
  
  namespace boost {
  template&lt;&gt;
  struct property_map&lt;Graph, vertex_index_t &gt; {
      typedef VertexIndexMap const_type;
  };
  
  }
  
  }
  </code></pre>
  
  <p>Please help me out.</p>
  
  <p><strong><em>EDIT</em></strong></p>
  
  <p>Below is my current solution, don't know if it's correct.</p>
  
  <pre><code>#include &lt;boost/graph/adjacency_list.hpp&gt;
  
  namespace MyNameSpace {
  
  using namespace boost;
  
  struct VertexP {
      std::string name;
      unsigned int id;
  };
  
  typedef adjacency_list&lt;vecS, listS, bidirectionalS, VertexP&gt; Graph;
  
  class VertexIndexMap {
  public:
      typedef boost::readable_property_map_tag category;
      typedef size_t  value_type;
      typedef value_type reference;
      typedef Graph::vertex_descriptor key_type;
  
      VertexIndexMap(const Graph&amp; g): _g(&amp;g) {}
  
      const Graph * _g;
  };
  
  }
  
  namespace boost {
  
  template&lt;&gt;
  struct property_map&lt;Graph, vertex_index_t &gt; {
      typedef VertexIndexMap const_type;
  };
  
  }
  
  namespace MyNameSpace {
    // the remaining code in namespace MyNameSpace
  }
  </code></pre>