Hi,
I tried to compile dijkstra-example-listS (BGL CVS) in MSVC 6.0.
There were several errors.
In the code
tie(e, inserted) = add_edge(edge_array[j].first, edge_array[j].second, g);
The variable int edge_array[j].first and edge_array[j].second cannot be
converted to descriptors.
To solve this, I have to map int (A, B, C, D, E) to descriptor first:
std::pair
On Apr 14, 2005, at 11:22 PM, Vivid Yang wrote:
I tried to compile dijkstra-example-listS (BGL CVS) in MSVC 6.0. There were several errors. In the code
tie(e, inserted) = add_edge(edge_array[j].first, edge_array[j].second, g);
The variable int edge_array[j].first and edge_array[j].second cannot be converted to descriptors.
To solve this, I have to map int (A, B, C, D, E) to descriptor first: std::pair
maps[5]; int c = 0; graph_traits ::vertex_iterator i, iend; for (tie(i, iend) = vertices(g); i != iend; ++i, ++c) { maps[c] = std::pair (c, *i); }
Yep, the MSVC 6 workaround was broken. I've fixed it in Boost CVS for the next release, but see below for the code if you want to try it yourself.
------------------------------------------------------------------
The same problem happens in dijkstra_shortest_paths.hpp In the lines :
typename graph_traits<VertexListGraph>::vertex_iterator ui, ui_end; put(distance, *ui, inf); put(predecessor, *ui, *ui); put(distance, s, zero);
They cannot convert descriptor s and (*ui) from (void *) to int Here is the error description: boost\boost_1_32_0\boost\graph\dijkstra_shortest_paths.hpp(211) : error C2664: 'void __cdecl boost::put(int *,int,const double &)' : cannot convert parameter 2 from 'void *' to 'int' This conversion requires a reinterpret_cast, a C-style cast or function-style cast
If you find where the #if defined(BOOST_MSVC)... line is, replace the
conditional block with:
#if defined(BOOST_MSVC) && BOOST_MSVC <= 1300
graph_t g(num_nodes);
property_map
Hello, I was investigating ways to implement Named Template Parameters. I ran into this post from the archives. http://lists.boost.org/MailArchives/boost/msg29429.php 1. Is the ntp namespace around anymore or is it now spelled named_template_params.hpp in boost/detail? 2. Is there a simple example of using the facilities in named_template_params.hpp? 3. Should I just go with the technique provided by Vandevoorde and Josuttis in Chapter 16 of C++ Template: The Complete Guide? Or is named_template_params.hpp that technique and I am just not seeing it? Regards, Bruce
"Bruce Trask"
Hello,
I was investigating ways to implement Named Template Parameters. I ran into this post from the archives.
http://lists.boost.org/MailArchives/boost/msg29429.php
1. Is the ntp namespace around anymore or is it now spelled named_template_params.hpp in boost/detail?
2. Is there a simple example of using the facilities in named_template_params.hpp?
3. Should I just go with the technique provided by Vandevoorde and Josuttis in Chapter 16 of C++ Template: The Complete Guide? Or is named_template_params.hpp that technique and I am just not seeing it?
Bruce, I'm away from the net at the moment and can't examine that link. However, Daniel Wallin and I are trying to finalize our recently-accepted named (function) parameters library for inclusion into Boost, and we're trying to generalize it so it will just be called the Boost Parameter library. The first generalization is support for unnamed function parameters (these are positionless and identifiable by type), but we also plan to add named template parameters. We think we can reuse a great deal of our existing code to support that. -Dave -- Dave Abrahams Boost Consulting www.boost-consulting.com
participants (4)
-
Bruce Trask
-
David Abrahams
-
Douglas Gregor
-
Vivid Yang