• Cite Icon9
  • https://doi.org/10.1145/1363686.1363735Copy DOI Icon

Lambda functions for C++0x

  • Mar 16, 2008
  • Jaakko Järvi +1 more
Show More
  • Abstract
  • Literature Map
  • References
  • Citations
  • Similar Papers
Abstract

A functional style of programming has become common in C++, following the introduction of the Standard Template Library (STL) into C++'s standard library. C++ is, however, notably lacking in its support for this style and thus cannot take full advantage of its own standard libraries. C++'s mechanisms for defining functions or objects to pass to STL algorithms are overly verbose. The effective use of modern C++ libraries calls for lambda functions in the language.This paper describes a design and implementation of built-in lambda functions for C++. C++'s compilation model, where activation records are maintained in a stack, and the lack of automatic object lifetime management, make safe lambda functions and closures challenging: if a closure outlives its scope of definition, references stored in a closure dangle. Our design is careful to balance between conciseness of syntax and explicit annotations to guarantee safety.Lambda functions can be declared without annotating their parameter types. C++0x, the forthcoming revision of standard C++, supports constrained templates and modular type checking. We describe how to infer parameter types of lambda functions from the constraints of generic functions in order to support modular type checking in the presence of lambda functions. Our design is currently under consideration for adoption to C++0x.

Similar Papers
  • Research Article
  • Citations1

Tensor contraction in C++

  • Jan 01, 2001
  • IEEE Computer Graphics and Applications
  • J.F Blinn
  • PDF
  • Research Article
  • Citations4

Complete Traversals and their Implementation Using the Standard Template Library

  • Dec 01, 1998
  • CLEI Electronic Journal
  • Eric Gamess +2
  • Book Chapter
  • Citations1

Theory and Generality of Complete Traversals

  • Jan 01, 2000
  • David R Musser +1
  • Research Article

General education in the computer science curriculum

  • Apr 20, 2001
  • Journal of Computing Sciences in Colleges
  • M Mullinspaul
  • Research Article

Integration of the Standard Template Library and the Microsoft Foundation Class

  • Jun 01, 1999
  • ACM SIGPLAN Notices
  • Paul Wolfgang +1
  • Research Article
  • Citations1

An architecture for generic extensions

  • Sep 25, 2009
  • Science of Computer Programming
  • Cosmin E Oancea +1
  • Conference Article
  • Citations5

Towards an automatic complexity analysis for generic programs

  • Sep 16, 2006
  • Kyle D Ross
  • Research Article
  • Citations32

STLlint: lifting static checking from languages to libraries

  • Sep 15, 2005
  • Software: Practice and Experience
  • Douglas Gregor +1
  • Research Article

Web labs for the Standard Template Library and the Java generic library in a CS2 course

  • Mar 01, 1999
  • ACM SIGCSE Bulletin
  • William J Collins +1
  • Conference Article

The Development and Application of Analysis System of Wind Characteristics Observation for Bridge in the West Inland

  • May 16, 2011
  • Zhang Yue +1
  • Conference Article

Web labs for the Standard Template Library and the Java generic library in a CS2 course

  • Mar 01, 1999
  • William J Collins +1
  • Book Chapter

Adapting to Boost Graphs

  • Jan 01, 2011
  • Efi Fogel +2
  • Book Chapter
  • Citations39

Component Programming — a fresh look at software components

  • Jan 01, 1995
  • Mehdi Jazayeri
  • Conference Article
  • Citations8

Data Layout and SIMD Abstraction Layers: Decoupling Interfaces from Implementations

  • Jul 01, 2018
  • Sylvain Jubertie +2
  • Research Article
  • Citations27

Task-parallel implementation of 3D shortest path raytracing for geophysical applications

  • Dec 19, 2012
  • Computers & Geosciences
  • Bernard Giroux +1
Cactus Communications logo

Copyright 2026 Cactus Communications. All rights reserved.