COIN-OR::LEMON - Graph Library

Changeset 269:f5965bbf1353 in lemon-1.2


Ignore:
Timestamp:
09/21/08 18:09:47 (16 years ago)
Author:
Peter Kovacs <kpeter@…>
Branch:
default
Phase:
public
Message:

Improvements in named-param.dox (ticket #147)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • doc/named-param.dox

    r268 r269  
    1 /* -*- C++ -*-
     1/* -*- mode: C++; indent-tabs-mode: nil; -*-
    22 *
    3  * This file is a part of LEMON, a generic C++ optimization library
     3 * This file is a part of LEMON, a generic C++ optimization library.
    44 *
    55 * Copyright (C) 2003-2008
     
    2626function parameters by name also when you call the function. It is
    2727especially comfortable in case of a function having tons of parameters
    28 with natural default values. Sadly, C++ lack this amenity. 
     28with natural default values. Sadly, C++ lack this amenity.
    2929
    3030However, with a crafty trick and with some little
     
    3333
    3434\code
    35 class namedFn 
     35class namedFn
    3636{
    3737  int _id;
    3838  double _val;
    3939  int _dim;
    40  
     40
    4141  public:
    4242  namedFn() : _id(0), _val(1), _dim(2) {}
     
    4646
    4747  run() {
    48   std::cout << "Here comes the function itself\n" <<
    49             << "With parameters "
    50             << _id << ", " << _val << ", " << _dim << std::endl;
     48    std::cout << "Here comes the function itself\n" <<
     49              << "With parameters "
     50              << _id << ", " << _val << ", " << _dim << std::endl;
    5151  }
    5252};
     
    7777\section named-templ-func-param Named Function Template Parameters
    7878
    79 A named parameter can also be a template functions. The usage is
     79A named parameter can also be a template function. The usage is
    8080exactly the same, but the implementation behind is a kind of black
    8181magic and they are the dirtiest part of the LEMON code.
     
    104104
    105105\code
    106 Dijkstra<>::SetPredNodeMap<NullMap<Node,Node> >::Create
     106Dijkstra<>::SetPredMap<NullMap<Node,Arc> >::Create
    107107\endcode
    108108
     
    111111
    112112\code
    113 Dijkstra<>::SetDistMap<MyMap>::SetPredMap<NullMap<Node,Edge> >::Create
     113Dijkstra<>::SetDistMap<MyMap>::SetPredMap<NullMap<Node,Arc> >::Create
    114114\endcode
    115115
Note: See TracChangeset for help on using the changeset viewer.