doc/maps2.dox
changeset 2505 1bb471764ab8
parent 2391 14a343be7a5a
child 2553 bfced05fa852
equal deleted inserted replaced
1:2cae51bc9c82 2:377529893bf2
    40 \code
    40 \code
    41 struct MyMap 
    41 struct MyMap 
    42 {
    42 {
    43   typedef double Value;
    43   typedef double Value;
    44   typedef Graph::Edge Key;
    44   typedef Graph::Edge Key;
    45   double operator[](Key e) const { return M_PI;}
    45   double operator[](const Key &e) const { return M_PI;}
    46 };
    46 };
    47 \endcode
    47 \endcode
    48 
    48 
    49 An alternative way to define maps is to use MapBase
    49 An alternative way to define maps is to use MapBase
    50 
    50 
    51 \code
    51 \code
    52 struct MyMap : public MapBase<Graph::Edge,double>
    52 struct MyMap : public MapBase<Graph::Edge,double>
    53 {
    53 {
    54   Value operator[](Key e) const { return M_PI;}
    54   Value operator[](const Key& e) const { return M_PI;}
    55 };
    55 };
    56 \endcode
    56 \endcode
    57 
    57 
    58 Here is a bit more complex example.
    58 Here is a bit more complex example.
    59 It provides a length function obtained
    59 It provides a length function obtained