Ticket #7600: named_graph.patch

File named_graph.patch, 1.4 KB (added by Louis Dionne <louis.dionne92@…>, 10 years ago)

possible fix

  • named_graph.hpp

    old new  
    1111#define BOOST_GRAPH_NAMED_GRAPH_HPP
    1212
    1313#include <boost/config.hpp>
     14#include <boost/type_traits/is_same.hpp>
    1415#include <boost/type_traits/remove_cv.hpp>
    1516#include <boost/type_traits/remove_reference.hpp>
     17#include <boost/mpl/not.hpp>
    1618#include <boost/multi_index_container.hpp>
    1719#include <boost/multi_index/hashed_index.hpp>
    1820#include <boost/multi_index/member.hpp>
    1921#include <boost/optional.hpp>
    2022#include <boost/throw_exception.hpp>
     23#include <boost/utility/enable_if.hpp>
    2124#include <stdexcept> // for std::runtime_error
    2225
    2326namespace boost { namespace graph {
     
    352355
    353356/// Retrieve the vertex associated with the given name, or add a new
    354357/// vertex with that name if no such vertex is available.
    355 template<BGL_NAMED_GRAPH_PARAMS>
    356 Vertex
     358/// Note: This is enabled only when the vertex property type is different
     359///       from the vertex name to avoid ambiguous overload problems with
     360///       the add_vertex() function that takes a vertex property.
     361template<BGL_NAMED_GRAPH_PARAMS>
     362    typename enable_if<mpl::not_<is_same<
     363        typename BGL_NAMED_GRAPH::vertex_name_type,
     364        VertexProperty
     365    > >,
     366Vertex>::type
    357367add_vertex(typename BGL_NAMED_GRAPH::vertex_name_type const& name,
    358368           BGL_NAMED_GRAPH& g)
    359369{