Skip to main content

C++ Function Object Binders Made Easy

  • Conference paper
  • First Online:
Generative and Component-Based Software Engineering (GCSE 1999)

Part of the book series: Lecture Notes in Computer Science ((LNCS,volume 1799))

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 efficient in the sense that it induces very little or no runtime cost.

This work has been supported by the Academy of Finland, grant 37178. The author is grateful to Harri Hakonen and Daveed Vandevoorde for their valuable comments on the manuscript of this paper.

This is a preview of subscription content, log in via an institution to check access.

Access this chapter

Chapter
USD 29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
eBook
USD 39.99
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD 54.99
Price excludes VAT (USA)
  • Compact, lightweight edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info

Tax calculation will be finalised at checkout

Purchases are for personal use only

Institutional subscriptions

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

References

  1. Stepanov, A. A., Lee, M.: The Standard Template Library. Hewlett-Packard Laboratories Technical Report HPL-94-34(R.1) (1994) http://www.hpl.hp.com/techreports.

  2. International Standard, Programming Languages — C++. ISO/IEC:14882 (1998).

    Google Scholar 

  3. The SGI Standard Template Library. Silicon Graphics Computer Systems Inc. http://www.sgi.com/Technology/STL.

  4. Liskov, B., Curtis, D., Day, M., Ghemawat S., Gruber R., Johnson, P., Myers A. C.: Theta Reference Manual, Preliminary version. Programming Methodology Group Memo 88 1995, MIT Lab. for Computer Science http://www.pmg.lcs.mit.edu/Theta.html.

  5. Agents, iterators and introspection. Interactive Software Engineering Inc. Technology paper http://www.eiffel.com.

  6. Stroustrup, B.: The C++ Programming Language-Third Edition. Addison-Wesley, Reading, Massachusetts 1997.

    Google Scholar 

  7. Järvi J.: Tuples and multiple return values in C++. submitted for publication, see TUCS Technical Report 249 (1999) http://www.tucs.fi/publications.

  8. Veldhuizen, T.: Using C++ Template Metaprograms. C++ Report 7 (1995) 36–43.

    Google Scholar 

  9. Järvi J.: Compile Time Recursive Objects in C++. Proceedings of the TOOLS 27 conference (Beijing Sept. 1998) 66–77. IEEE Computer Society Press.

    Google Scholar 

  10. Czarnecki, K.: Generative Programming: Principles and Techniques of Software Engineering Based on Automated Configuration and Fragment-Based Component Models. Ph.D. Thesis, Technische Universität Ilmenau, Germany 1998.

    Google Scholar 

  11. The GNU Compiler Collection. http://www.gnu.org/software/gcc/gcc.html.

Download references

Author information

Authors and Affiliations

Authors

Editor information

Editors and Affiliations

Rights and permissions

Reprints and permissions

Copyright information

© 2000 Springer-Verlag Berlin Heidelberg

About this paper

Cite this paper

Järvi, J. (2000). C++ Function Object Binders Made Easy. In: Czarnecki, K., Eisenecker, U.W. (eds) Generative and Component-Based Software Engineering. GCSE 1999. Lecture Notes in Computer Science, vol 1799. Springer, Berlin, Heidelberg. https://doi.org/10.1007/3-540-40048-6_13

Download citation

  • DOI: https://doi.org/10.1007/3-540-40048-6_13

  • Published:

  • Publisher Name: Springer, Berlin, Heidelberg

  • Print ISBN: 978-3-540-41172-7

  • Online ISBN: 978-3-540-40048-6

  • eBook Packages: Springer Book Archive

Publish with us

Policies and ethics