Improvements in named-param.dox (ticket #147)
authorPeter Kovacs <kpeter@inf.elte.hu>
Sun, 21 Sep 2008 18:09:47 +0200
changeset 269f5965bbf1353
parent 268 986d30f5c1c0
child 270 58b0b3c0015e
Improvements in named-param.dox (ticket #147)
doc/named-param.dox
     1.1 --- a/doc/named-param.dox	Sun Sep 21 07:49:57 2008 +0100
     1.2 +++ b/doc/named-param.dox	Sun Sep 21 18:09:47 2008 +0200
     1.3 @@ -1,6 +1,6 @@
     1.4 -/* -*- C++ -*-
     1.5 +/* -*- mode: C++; indent-tabs-mode: nil; -*-
     1.6   *
     1.7 - * This file is a part of LEMON, a generic C++ optimization library
     1.8 + * This file is a part of LEMON, a generic C++ optimization library.
     1.9   *
    1.10   * Copyright (C) 2003-2008
    1.11   * Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
    1.12 @@ -25,19 +25,19 @@
    1.13  Several modern languages provide a convenient way to refer the
    1.14  function parameters by name also when you call the function. It is
    1.15  especially comfortable in case of a function having tons of parameters
    1.16 -with natural default values. Sadly, C++ lack this amenity. 
    1.17 +with natural default values. Sadly, C++ lack this amenity.
    1.18  
    1.19  However, with a crafty trick and with some little
    1.20  inconvenience, it is possible to emulate is.
    1.21  The example below shows how to do it.
    1.22  
    1.23  \code
    1.24 -class namedFn 
    1.25 +class namedFn
    1.26  {
    1.27    int _id;
    1.28    double _val;
    1.29    int _dim;
    1.30 -  
    1.31 +
    1.32    public:
    1.33    namedFn() : _id(0), _val(1), _dim(2) {}
    1.34    namedFn& id(int p)     { _id  = p ; return *this; }
    1.35 @@ -45,9 +45,9 @@
    1.36    namedFn& dim(int p)    { _dim = p ; return *this; }
    1.37  
    1.38    run() {
    1.39 -  std::cout << "Here comes the function itself\n" <<
    1.40 -            << "With parameters "
    1.41 -            << _id << ", " << _val << ", " << _dim << std::endl; 
    1.42 +    std::cout << "Here comes the function itself\n" <<
    1.43 +              << "With parameters "
    1.44 +              << _id << ", " << _val << ", " << _dim << std::endl;
    1.45    }
    1.46  };
    1.47  \endcode
    1.48 @@ -76,7 +76,7 @@
    1.49  
    1.50  \section named-templ-func-param Named Function Template Parameters
    1.51  
    1.52 -A named parameter can also be a template functions. The usage is
    1.53 +A named parameter can also be a template function. The usage is
    1.54  exactly the same, but the implementation behind is a kind of black
    1.55  magic and they are the dirtiest part of the LEMON code.
    1.56  
    1.57 @@ -103,14 +103,14 @@
    1.58  be used as shown in the following example.
    1.59  
    1.60  \code
    1.61 -Dijkstra<>::SetPredNodeMap<NullMap<Node,Node> >::Create
    1.62 +Dijkstra<>::SetPredMap<NullMap<Node,Arc> >::Create
    1.63  \endcode
    1.64  
    1.65  It can also be used in conjunction with other named template
    1.66  parameters in arbitrary order.
    1.67  
    1.68  \code
    1.69 -Dijkstra<>::SetDistMap<MyMap>::SetPredMap<NullMap<Node,Edge> >::Create
    1.70 +Dijkstra<>::SetDistMap<MyMap>::SetPredMap<NullMap<Node,Arc> >::Create
    1.71  \endcode
    1.72  
    1.73  The result will be an instantiated Dijkstra class, in which the