skip to main content
10.1145/268084.268095acmconferencesArticle/Chapter ViewAbstractPublication PagessigcseConference Proceedingsconference-collections
Article
Free Access

Function objects, function templates, and passage by behavior in C++

Published:01 March 1997Publication History

ABSTRACT

Passing functions and function objects to general purpose routines is a powerful abstraction mechanism that should be taught in freshman computer science. In C++, a "function" can be defined directly by the user or by a library or can be defined indirectly via operator() as a member function of a class. It is not obvious how to treat these "functions" in a uniform manner. We will show how function templates in C++ provide an elegant and teachable mechanism for passing entities with functional behavior as arguments to other functions.

References

  1. 1.Barton, John. J. and Nackman, Lee R., Scientific alrl Engineering C++: An Introduction With Advanced Techniques and Examples,, Addison-Wesley, Reading, MA, 1994. Google ScholarGoogle ScholarDigital LibraryDigital Library
  2. 2.Ellis, Margaret A. and Stroustrup, Bjame, The Annotated C++ Reference Manual, ANSI Base Document, Addison-Wesley, Reading, MA, 1990. Google ScholarGoogle ScholarDigital LibraryDigital Library
  3. 3.Meyers, Scott, Effective C++: 50 Ways to Improve Your Programs and Designs, Addison-Wesley, Reading, /VIA, 1992. Google ScholarGoogle ScholarDigital LibraryDigital Library
  4. 4.Meyers, Scott, More Effective C++: 35 New Ways to Improve Your Programs and Designs, Addison-Wesley, Reading, MA, 1996. Google ScholarGoogle ScholarDigital LibraryDigital Library
  5. 5.Musser, David and Saini, Atul, STL Tutorial atzl Reference Guide: C++ Programming with the Standard Template Library, Addison-Wesley, Reading, MA, 1996. Google ScholarGoogle ScholarDigital LibraryDigital Library
  6. 6.Pattis, Richard, Teaching C++ as an Introductory Programming Language (an electronic newsletter), Vol 1::2, February 15, 1996. Contaet: [email protected],Google ScholarGoogle Scholar
  7. 7.Stroustrup, Bjarne, The C++ Programming Langttage, 2nd Edition, Addison-Wesley, Reading, MA, 1991. Google ScholarGoogle ScholarDigital LibraryDigital Library
  8. 8.Stroustrup, Bjarne, The Design and Evolution of C++, Addison-Wesley, Reading, MA, 1994. Google ScholarGoogle ScholarDigital LibraryDigital Library

Index Terms

  1. Function objects, function templates, and passage by behavior in C++

      Recommendations

      Comments

      Login options

      Check if you have access through your login credentials or your institution to get full access on this article.

      Sign in
      • Published in

        cover image ACM Conferences
        SIGCSE '97: Proceedings of the twenty-eighth SIGCSE technical symposium on Computer science education
        March 1997
        410 pages
        ISBN:0897918894
        DOI:10.1145/268084

        Copyright © 1997 ACM

        Permission to make digital or hard copies of all or part of this work for personal or classroom use is granted without fee provided that copies are not made or distributed for profit or commercial advantage and that copies bear this notice and the full citation on the first page. Copyrights for components of this work owned by others than ACM must be honored. Abstracting with credit is permitted. To copy otherwise, or republish, to post on servers or to redistribute to lists, requires prior specific permission and/or a fee. Request permissions from [email protected]

        Publisher

        Association for Computing Machinery

        New York, NY, United States

        Publication History

        • Published: 1 March 1997

        Permissions

        Request permissions about this article.

        Request Permissions

        Check for updates

        Qualifiers

        • Article

        Acceptance Rates

        SIGCSE '97 Paper Acceptance Rate75of177submissions,42%Overall Acceptance Rate1,595of4,542submissions,35%

        Upcoming Conference

        SIGCSE Virtual 2024

      PDF Format

      View or Download as a PDF file.

      PDF

      eReader

      View online with eReader.

      eReader