Boost logo

Boost :

From: Jeremy Siek (jsiek_at_[hidden])
Date: 2000-11-02 20:30:49


Hi John,

Right, Dave reported this one to me as well. I've added a note
to the trouble-shooting page with the workaround you did
(well, a mostly equivalent one using another get() instead of operator[]).

The error is quite mysterious... VC++ is complaining about
operator[] not being defined in the adj_list_edge_property_map class
even though it clearly is defined. I've tried basically making
random changes to how that get() function is implemented to
try to work around the problem, but have not yet been successful.

Ciao,

Jeremy

On Thu, 2 Nov 2000, John Britton wrote:

> I found that one version of boost::get fails compile (under VC++), while
> another, allegedly equivalent, version does not.
>
> #pragma warning (disable: 4786)
> #include <boost/graph/adjacency_list.hpp>
>
> /*==== foo */
> void foo() {
> //---- create undirected graph, with edge_index property
> typedef boost::adjacency_list<
> boost::vecS, boost::vecS, boost::undirectedS,
> boost::property< boost::vertex_color_t, boost::default_color_type >,
> boost::property< boost::edge_index_t, size_t >
> > graph_t;
> graph_t g( 3 );
> boost::add_edge( 0, 1, 0, g );
> boost::add_edge( 1, 2, 0, g );
>
> //---- get index of the first edge
> #if 1
> // THIS STATEMENT FAILS VC++ COMPILE WITH "property_map.hpp(283) : error
> C2678..."
> boost::get( boost::edge_index, g, *boost::edges( g ).first );
> #else
> // THIS STATEMENT DOES NOT FAIL COMPILE
> boost::get( boost::edge_index, g )[ *boost::edges( g ).first ];
> #endif
>
> }
>
> John Britton
> Very Important Engineer++
> Peak Audio Inc.
> 1790 30th Street, Suite 414
> Boulder, CO 80301
> 303.449.9337 x102
> johnb_at_[hidden]
> http://www.peakaudio.com/
>
>
>
>
>

----------------------------------------------------------------------
 Jeremy Siek www: http://www.lsc.nd.edu/~jsiek/
 Ph.D. Candidate email: jsiek_at_[hidden]
 Univ. of Notre Dame work phone: (219) 631-3906
----------------------------------------------------------------------


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk