<div dir="ltr"><div><br></div>Since my graph, g,  of type graph_t is:<br><div><br>    typedef boost::property &lt;boost::edge_weight_t, float &gt; edge_properties;<br>    //typedef boost::property&lt;boost::vertex_<wbr>first_name_t, std::string&gt; vertex_properties;<br>    <br>    typedef boost::property&lt;boost::vertex_<wbr>index1_t, size_t,<br>        boost::property&lt;boost::vertex_<wbr>component_t, int&gt; &gt; vertex_properties;<br>    <br>    typedef boost::property&lt;boost::vertex_<wbr>color_t, boost::default_color_type&gt; color_properties;<br><br>    //typedef boost::property&lt;boost::vertex_<wbr>index1_t, size_t,<br>    //    boost::property&lt;boost::vertex_<wbr>component_t, int, <br>    //        boost::property&lt;boost::vertex_<wbr>color_t, boost::default_color_type&gt;&gt; &gt; vertex_properties;<br><br><br>#define USE_BOOST_GRAPH_VECS<br><br>    typedef boost::adjacency_list&lt;<br>#ifdef USE_BOOST_GRAPH_VECS<br>        // !NOTE: see:<a href="https://stackoverflow.com/questions/15649166/bgl-depth-first-search-error-with-color-map#15654246" target="_blank">https://stackoverflow.com/<wbr>questions/15649166/bgl-depth-<wbr>first-search-error-with-color-<wbr>map#15654246</a><br>        // This is the important part of the &quot;sea of errors&quot;.<br>        // Only adjacency_list that have vecS as the VertexList <br>        // template parameter have a default internal vertex_index<br>        // property and this property is used by the default color <br>        // map(you are using listS).<br>        boost::vecS, boost::vecS,<br>        //boost::vecS, boost::listS, <br>        //boost::setS, boost::listS, <br>#else<br>        // !Note: See <a href="http://www.boost.org/doc/libs/1_62_0/libs/graph/doc/adjacency_list.html" target="_blank">http://www.boost.org/doc/libs/<wbr>1_62_0/libs/graph/doc/<wbr>adjacency_list.html</a><br>        // Iterator and Descriptor Stability/Invalidation regarding iterator stability when using<br>        // the vector and list containers.<br>        boost::listS, boost::listS,<br>#endif<br>        boost::undirectedS,<br>        //boost::bidirectionalS,<br>        //boost::no_property,<br>        vertex_properties,<br>        edge_properties,<br>        //color_properties, <br>        boost::vecS<br>        &gt; graph_t;<br>    graph_t g;<br><br></div><div><br></div><div>and is/was created without color properties (color_properties or vertex_color_t).  When trying to create a colormap with:<br></div><div><br></div><div>property_map&lt;graph_t, boost::vertex_color_t&gt;::type colors = get(vertex_color_t(), g);<br></div><div><br></div><div>the error is generated by VS:<br></div><div><br></div><div>boost-1_60\boost/graph/detail/<wbr>adjacency_list.hpp(2584): error C2182: &#39;reference&#39; : illegal use of type &#39;void&#39;<br></div><div><br></div><div>which is ofcourse not real clear what is generating the error but after finding the actual offending line 5 lines later in the error console as is the power of template meta programing.  The &quot;illegal use of type &#39;void&#39;&quot; error is a result of the graph not having an internal property that can be accessed by get:<br></div><div><br></div><div>template &lt;class PropertyTag&gt;<br>property_map&lt;filtered_graph, PropertyTag&gt;::type get(PropertyTag, filtered_graph&amp; g)<br></div><div><br></div><div>Adding the property internal to the graph by commenting out:<br></div><div><br></div><div>    typedef boost::property&lt;boost::vertex_<wbr>index1_t, size_t,<br>        boost::property&lt;boost::vertex_<wbr>component_t, int&gt; &gt; vertex_properties;<br>    <br></div><div><br></div><div>And uncommenting (putting it it place of above):<br></div><div><br>    typedef boost::property&lt;boost::vertex_<wbr>index1_t, size_t,<br>        boost::property&lt;boost::vertex_<wbr>component_t, int, <br>            boost::property&lt;boost::vertex_<wbr>color_t, boost::default_color_type&gt;&gt; &gt; vertex_properties</div><br><div>The property is now internal and so a vertex colormap can be generated using:<br></div><div><br></div><div>property_map&lt;graph_t, boost::vertex_color_t&gt;::type colors = get(vertex_color_t(), g);</div><div class="gmail_extra"><br></div><div class="gmail_extra"><br></div><div class="gmail_extra">However an external colormap could be used:</div><div class="gmail_extra"><br></div><div class="gmail_extra"><br></div><div class="gmail_extra">    typedef std::vector&lt;int&gt; ColorMap_t;<br>    ColorMap_t colors(num_vertices(g));<br><br>    vertex_color_filter_eq&lt;<wbr>ColorMap_t&gt; filter(colors);<br>    <br>    // boost::filtered_graph&lt;graph_t, boost::keep_all, VertexPredicate&gt;<br>    boost::filtered_graph&lt;graph_t, boost::keep_all, vertex_color_filter_eq&lt;<wbr>ColorMap_t&gt;&gt; fg(g, boost::keep_all(), filter);<br></div><div class="gmail_extra"><br></div><div class="gmail_extra"><br></div><div class="gmail_extra">Note now the successful attempt to use boost::keep_all and boost::keep_all()</div><div class="gmail_extra"><br></div><div class="gmail_extra"><br></div></div>