Boost logo

Boost Users :

Subject: [Boost-users] [graph] ambiguity moving from 1.48 to 1.54
From: Richi Lists (ricul77_at_[hidden])
Date: 2013-10-25 10:40:36


Hi,

I'm in the process of upgrading from boost 1.48 to 1.54.
We're using MSVC10.
Most stuff that comes up is easy to fix, but this one gives me
headaches:

...boost\boost_1_54_0\boost/pending/property.hpp(108): error C2752:
'boost::lookup_one_property_internal<PList,PropName>' : more than one
partial specialization matches the template argument list
  with
  [
          PList=boost::property<boost::edge_bundle_t,EdgeData>,
          PropName=boost::edge_bundle_t
  ]
  ...boost\boost_1_54_0\boost/pending/property.hpp(114): could be
'boost::lookup_one_property_internal<boost::property<Tag,T,Base>,Tag>'
  ...boost\boost_1_54_0\boost/pending/property.hpp(108): or
'boost::lookup_one_property_internal<boost::property<Tag,T,Base>,boost::edge_bundle_t>'
  ...boost\boost_1_54_0\boost/pending/property.hpp(108): or
'boost::lookup_one_property_internal<T,boost::edge_bundle_t>'
  ...boost\boost_1_54_0\boost/pending/property.hpp(158) : see reference
to class template instantiation
'boost::lookup_one_property_internal<PList,PropName>' being compiled
  with
  [

PList=boost::property<boost::edge_index_t,int,boost::property<boost::edge_bundle_t,EdgeData>>,
          PropName=boost::edge_bundle_t
  ]
  ...boost\boost_1_54_0\boost/graph/detail/adjacency_list.hpp(1505) :
see reference to class template instantiation
'boost::lookup_one_property<T,Tag>' being compiled
  with
  [

T=boost::property<boost::edge_index_t,int,boost::property<boost::edge_bundle_t,EdgeData>>,
          Tag=boost::edge_bundle_t
  ]
  ...boost\boost_1_54_0\boost/graph/detail/adjacency_list.hpp(2028) :
see reference to class template instantiation
'boost::adj_list_helper<Config,Base>' being compiled
  with
  [

Config=boost::detail::adj_list_gen<boost::adjacency_list<boost::vecS,boost::vecS,boost::undirectedS,VertexProps,EdgeProps>,boost::vecS,boost::vecS,boost::undirectedS,VertexProps,EdgeProps,boost::no_property,boost::listS>::config,

Base=boost::undirected_graph_helper<boost::detail::adj_list_gen<boost::adjacency_list<boost::vecS,boost::vecS,boost::undirectedS,VertexProps,EdgeProps>,boost::vecS,boost::vecS,boost::undirectedS,VertexProps,EdgeProps,boost::no_property,boost::listS>::config>
  ]
  ...boost\boost_1_54_0\boost/graph/adjacency_list.hpp(267) : see
reference to class template instantiation
'boost::vec_adj_list_impl<Graph,Config,Base>' being compiled
  with
  [

Graph=boost::adjacency_list<boost::vecS,boost::vecS,boost::undirectedS,VertexProps,EdgeProps>,

Config=boost::detail::adj_list_gen<boost::adjacency_list<boost::vecS,boost::vecS,boost::undirectedS,VertexProps,EdgeProps>,boost::vecS,boost::vecS,boost::undirectedS,VertexProps,EdgeProps,boost::no_property,boost::listS>::config,

Base=boost::undirected_graph_helper<boost::detail::adj_list_gen<boost::adjacency_list<boost::vecS,boost::vecS,boost::undirectedS,VertexProps,EdgeProps>,boost::vecS,boost::vecS,boost::undirectedS,VertexProps,EdgeProps,boost::no_property,boost::listS>::config>
  ]
  ..\graph_problem.cpp(52) : see reference to class template
instantiation
'boost::adjacency_list<OutEdgeListS,VertexListS,DirectedS,VertexProperty,EdgeProperty>' being compiled
  with
  [
          OutEdgeListS=boost::vecS,
          VertexListS=boost::vecS,
          DirectedS=boost::undirectedS,
          VertexProperty=VertexProps,
          EdgeProperty=EdgeProps
  ]
...boost\boost_1_54_0\boost/graph/adjacency_list.hpp(374): error C2182:
'[]' : illegal use of type 'void'

The code to reproduce is here:

// boost
#include <boost/graph/adjacency_list.hpp>
#include <boost/graph/subgraph.hpp>
#include <boost/graph/graph_traits.hpp>

class EDGE {};
//////////////////////////////////////////////////////////////////////////
/// graph's vertex data
struct VertexData
{
        /// c-tor
        VertexData() { pos[0] = 0.0; pos[1] = 0.0;
pos[2] = 0.0; }
        VertexData(const double* _pos) { pos[0] = _pos[0]; pos[1] = _pos[1];
pos[2] = _pos[2]; }

        /// data
        double pos[3];
};
//////////////////////////////////////////////////////////////////////////
/// graph's edge data
struct EdgeData
{
        /// c-tor
        EdgeData() : pEdge(NULL) {}
        EdgeData(EDGE* _pEdge) : pEdge(_pEdge) {}

        /// comparison for equality
        bool operator==(const EdgeData& dst) const
        {
                return pEdge == dst.pEdge;
        }

        /// data
        EDGE* pEdge;
};
//////////////////////////////////////////////////////////////////////////
/// types
typedef VertexData VertexProps; ///< custom vertex
properties
typedef boost::property<boost::edge_index_t, int,
boost::property<boost::edge_bundle_t, EdgeData> > EdgeProps; ///<
custom edge properties
typedef boost::adjacency_list<boost::vecS,
                                                                boost::vecS,
                                                                boost::undirectedS,
                                                                VertexProps,
                                                                EdgeProps> Type; ///< custom graph type
        
//////////////////////////////////////////////////////////////////////////
/// unary predicate for testing if edge has duplicates in graph
struct CheckDuplicateEdge
{
        CheckDuplicateEdge(const Type& _g) : g(_g) {}

        // check if this edge has duplicates
        bool operator()(const Type::edge_descriptor& e) const
        {
                // do something

                return false;
        }

private:
        const Type& g;
};
//////////////////////////////////////////////////////////////////////////
void RemoveDuplicateEdges(Type& g)
{
        remove_edge_if(CheckDuplicateEdge(g), g);
}
//////////////////////////////////////////////////////////////////////////
void main()
{
        std::cout << "hello graph";
}
//////////////////////////////////////////////////////////////////////////

I have tried to find a solution, and have searched the internet for
hours.
So, hopefully anybody here saw something similar, and solved it
already.

Rgds
Richard


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net