Boost logo

Boost :

From: David Abrahams (abrahams_at_[hidden])
Date: 2000-09-23 18:14:21


Hi Jeremy,

Trying to get your latest stuff to work for me under MSVC. Maybe you can do
better than me. Try this program:

#include <boost/graph/adjacency_list.hpp>
#include <boost/graph/properties.hpp>

namespace xx { namespace yy {

namespace lattice {

typedef boost::vecS EdgeList;
typedef boost::vecS VertexList;
typedef boost::bidirectionalS Directed;
typedef boost::plugin<boost::edge_weight, unsigned long,
          boost::plugin<boost::edge_name, const char*> > EdgePlugin;
typedef boost::no_plugin VertexPlugin;

typedef boost::adjacency_list<EdgeList, VertexList, Directed,
    VertexPlugin, EdgePlugin> Graph;

typedef boost::property_map<Graph, boost::edge_weight>::type Weights;
typedef boost::property_map<Graph, boost::edge_name>::type Names;
typedef boost::graph_traits<Graph>::edge_descriptor Edge;
}

typedef lattice::Graph Lattice;

inline lattice::Edge add_lattice_edge(Lattice& x, std::size_t start,
std::size_t end)
{
    using namespace boost; // ugliness
    return add_edge(x, start, end).first;
}

}} // namespace xx::yy

int main()
{
    xx::yy::Lattice lattice;
    for (int i = 0; i < argc; ++i)
    {
        lattice::Edge e = xx::yy::add_lattice_edge(lattice, i, i + 1);

        using namespace boost; // ugliness!
        boost::property_map<Lattice, boost::edge_name>::type names
            = get(boost::edge_name(), m_lattice);
        put(names, e, argv[argc]);
    }
    return 0;
}


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