Changeset 269:f5965bbf1353 in lemon-1.2
- Timestamp:
- 09/21/08 18:09:47 (16 years ago)
- Branch:
- default
- Phase:
- public
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
doc/named-param.dox
r268 r269 1 /* -*- C++-*-1 /* -*- mode: C++; indent-tabs-mode: nil; -*- 2 2 * 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. 4 4 * 5 5 * Copyright (C) 2003-2008 … … 26 26 function parameters by name also when you call the function. It is 27 27 especially comfortable in case of a function having tons of parameters 28 with natural default values. Sadly, C++ lack this amenity. 28 with natural default values. Sadly, C++ lack this amenity. 29 29 30 30 However, with a crafty trick and with some little … … 33 33 34 34 \code 35 class namedFn 35 class namedFn 36 36 { 37 37 int _id; 38 38 double _val; 39 39 int _dim; 40 40 41 41 public: 42 42 namedFn() : _id(0), _val(1), _dim(2) {} … … 46 46 47 47 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; 51 51 } 52 52 }; … … 77 77 \section named-templ-func-param Named Function Template Parameters 78 78 79 A named parameter can also be a template function s. The usage is79 A named parameter can also be a template function. The usage is 80 80 exactly the same, but the implementation behind is a kind of black 81 81 magic and they are the dirtiest part of the LEMON code. … … 104 104 105 105 \code 106 Dijkstra<>::SetPred NodeMap<NullMap<Node,Node> >::Create106 Dijkstra<>::SetPredMap<NullMap<Node,Arc> >::Create 107 107 \endcode 108 108 … … 111 111 112 112 \code 113 Dijkstra<>::SetDistMap<MyMap>::SetPredMap<NullMap<Node, Edge> >::Create113 Dijkstra<>::SetDistMap<MyMap>::SetPredMap<NullMap<Node,Arc> >::Create 114 114 \endcode 115 115
Note: See TracChangeset
for help on using the changeset viewer.