~ubuntu-branches/ubuntu/wily/libsigc++-2.0/wily-proposed

« back to all changes in this revision

Viewing changes to sigc++/adaptors/lambda/base.h

  • Committer: Bazaar Package Importer
  • Author(s): Daniel Burrows
  • Date: 2005-07-10 14:34:54 UTC
  • mfrom: (2.1.1 sarge)
  • Revision ID: james.westby@ubuntu.com-20050710143454-1lickjxb8hzzupx7
Tags: 2.0.10-3
Fix dh_makeshlibs call (it WOULD be the one that I didn't check that
needed to be changed; Closes: #317682).

Show diffs side-by-side

added added

removed removed

Lines of Context:
283
283
} /* namespace internal */
284
284
 
285
285
 
 
286
//template specialization of visit_each<>(action, functor):
286
287
template <class T_action, class T_functor, bool I_islambda>
287
288
void visit_each(const T_action& _A_action,
288
289
                const internal::lambda_core<T_functor, I_islambda>& _A_target)
340
341
};
341
342
 
342
343
 
 
344
//template specialization of visit_each<>(action, functor):
343
345
template <class T_action, class T_type>
344
346
void visit_each(const T_action& _A_action,
345
347
                const lambda<T_type>& _A_target)
348
350
}
349
351
 
350
352
 
351
 
/// Converts a reference into a lambda object.
 
353
/** Converts a reference into a lambda object.
 
354
 * sigc::var creates a 0-ary functor, returning the value of a referenced variable. 
 
355
 *
 
356
 * @par Example:
 
357
 *   @code
 
358
 *   int main(int argc, char* argv)
 
359
 *   {
 
360
 *     int data;
 
361
 *     sigc::signal<int> readValue;
 
362
 *
 
363
 *     readValue.connect(sigc::var(data));
 
364
 *
 
365
 *     data = 3;
 
366
 *     std::cout << readValue() << std::endl; //Prints 3.
 
367
 *
 
368
 *    data = 5;
 
369
 *    std::cout << readValue() << std::endl; //Prints 5.
 
370
 *   }
 
371
 *   @endcode
 
372
 */
352
373
template <class T_type>
353
374
lambda<T_type&> var(T_type& v)
354
375
{ return lambda<T_type&>(v); }
355
376
 
356
 
/// Converts a constant reference into a lambda object.
 
377
/** Converts a constant reference into a lambda object.
 
378
 */
357
379
template <class T_type>
358
380
lambda<const T_type&> var(const T_type& v)
359
381
{ return lambda<const T_type&>(v); }