C++ Function Object Binders Made Easy

  • Authors:
  • Jaakko Järvi

  • Affiliations:
  • -

  • Venue:
  • GCSE '99 Proceedings of the First International Symposium on Generative and Component-Based Software Engineering
  • Year:
  • 1999

Quantified Score

Hi-index 0.00

Visualization

Abstract

A novel argument binding mechanism that can be used with STL algorithm invocations is proposed. Without using any adaptors, binding can be applied directly to pointers to nonmember functions, pointers to const and nonconst member functions and STL function objects. The types and number of arguments in the functions to be bound can be practically arbitrary; argument list lengths up to few dozens of elements can be supported. The unbound arguments are expressed as special placeholders in the argument list; they can appear for any argument position. Hence, binding sites preserve the resemblance to the function prototype of the underlying function, leading to simple and intuitive syntax. Binding can be applied recursively. This results in a versatile function composition mechanism. The binding mechanism is effcient in the sense that it induces very little or no runtime cost.