ACM Home Page
Please provide us with feedback. Feedback
Function objects, function templates, and passage by behavior in C++
Full text PdfPdf (452 KB)
Source Technical Symposium on Computer Science Education archive
Proceedings of the twenty-eighth SIGCSE technical symposium on Computer science education table of contents
San Jose, California, United States
Pages: 35 - 38  
Year of Publication: 1997
ISBN:0-89791-889-4
Also published in ...
Author
Richard Rasala  Northeastern University, College of Computer Science, Boston, MA
Sponsor
SIGCSE: ACM Special Interest Group on Computer Science Education
Publisher
ACM  New York, NY, USA
Bibliometrics
Downloads (6 Weeks): 14,   Downloads (12 Months): 39,   Citation Count: 8
Additional Information:

abstract   references   cited by   index terms   collaborative colleagues  

Tools and Actions: Request Permissions Request Permissions    Review this Article  
DOI Bookmark: Use this link to bookmark this Article: http://doi.acm.org/10.1145/268084.268095
What is a DOI?

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.