mirror of
https://gitlab.com/fbb-git/cppannotations
synced 2024-11-16 07:48:44 +01:00
WIP, function wrappers now superseded by lambda functions
git-svn-id: https://cppannotations.svn.sourceforge.net/svnroot/cppannotations/trunk@426 f6dd340e-d3f9-0310-b409-bdd246841980
This commit is contained in:
parent
99e255da5d
commit
5ac352199c
2 changed files with 23 additions and 33 deletions
|
@ -58,26 +58,26 @@ includefile(concrete/bitwise)
|
||||||
lsect(A2X)(A text to anything converter)
|
lsect(A2X)(A text to anything converter)
|
||||||
includefile(concrete/a2x)
|
includefile(concrete/a2x)
|
||||||
|
|
||||||
COMMENT(>>>>>>>>>>>>> NEXT <<<<<<<<<<<<<)
|
COMMENT(SUPERSEDED BY LAMBDA FUNCTIONS
|
||||||
|
|
||||||
lsect(STLWRAPPERS)(Wrappers for STL algorithms)
|
lsect(STLWRAPPERS)(Wrappers for STL algorithms)
|
||||||
includefile(concrete/wrappers)
|
includefile(concrete/wrappers)
|
||||||
|
|
||||||
|
subsect(Local context structs)
|
||||||
|
includefile(concrete/context)
|
||||||
|
|
||||||
|
subsect(Member functions called from function objects)
|
||||||
|
includefile(concrete/members)
|
||||||
|
|
||||||
|
lsubsect(WRAPONE)
|
||||||
|
(The unary argument context sensitive Function Object template)
|
||||||
|
includefile(concrete/unary)
|
||||||
|
|
||||||
|
lsubsect(WRAPTWO)
|
||||||
|
(The binary argument context sensitive Function Object template)
|
||||||
|
includefile(concrete/binary)
|
||||||
|
|
||||||
subsect(Local context structs)
|
SO FAR)
|
||||||
includefile(concrete/context)
|
|
||||||
|
|
||||||
subsect(Member functions called from function objects)
|
|
||||||
includefile(concrete/members)
|
|
||||||
|
|
||||||
lsubsect(WRAPONE)
|
|
||||||
(The unary argument context sensitive Function Object template)
|
|
||||||
includefile(concrete/unary)
|
|
||||||
|
|
||||||
lsubsect(WRAPTWO)
|
|
||||||
(The binary argument context sensitive Function Object template)
|
|
||||||
includefile(concrete/binary)
|
|
||||||
|
|
||||||
COMMENT(DONE)
|
|
||||||
|
|
||||||
lsect(PROXY)(Distinguishing lvalues from rvalues with operator[]())
|
lsect(PROXY)(Distinguishing lvalues from rvalues with operator[]())
|
||||||
includefile(concrete/proxy)
|
includefile(concrete/proxy)
|
||||||
|
@ -85,7 +85,7 @@ lsect(PROXY)(Distinguishing lvalues from rvalues with operator[]())
|
||||||
lsect(CONCRETEITER)(Implementing a `reverse_iterator')
|
lsect(CONCRETEITER)(Implementing a `reverse_iterator')
|
||||||
includefile(concrete/iterators)
|
includefile(concrete/iterators)
|
||||||
|
|
||||||
COMMENT(SO FAR)
|
COMMENT(>>>>>>>>>>> NEXT)
|
||||||
|
|
||||||
lsect(BisonAndFlex)(Using `bisonc++' and `flex')
|
lsect(BisonAndFlex)(Using `bisonc++' and `flex')
|
||||||
includefile(concrete/bisonflex)
|
includefile(concrete/bisonflex)
|
||||||
|
|
|
@ -1,10 +1,6 @@
|
||||||
The C++0x standard adds emi(lambda function) em(lambda functions) into
|
The C++0x standard has added emi(lambda function) em(lambda functions) to
|
||||||
bf(C++). As there is currently no indication as to when this feature will
|
bf(C++). As we've seen generic algorithms often accept an argument that can
|
||||||
become available in the tt(g++) compiler this section will only cover the
|
either be a function object or a plain function. Examples are the tt(sort) and
|
||||||
concept, the proposed syntax and some examples.
|
|
||||||
|
|
||||||
As we've seen generic algorithms often accept an argument that can either
|
|
||||||
be a function object or a plain function. Examples are the tt(sort) and
|
|
||||||
tt(find_if) generic algorithms. When the function called by the generic
|
tt(find_if) generic algorithms. When the function called by the generic
|
||||||
algorithm must remember its state a function object is appropriate, otherwise
|
algorithm must remember its state a function object is appropriate, otherwise
|
||||||
a plain function will do.
|
a plain function will do.
|
||||||
|
@ -22,13 +18,7 @@ source file- code that is irrelevant at the current level of
|
||||||
specification. Nested classes don't solve these problems and nested classes
|
specification. Nested classes don't solve these problems and nested classes
|
||||||
can't be used in templates.
|
can't be used in templates.
|
||||||
|
|
||||||
Solutions to the above problems exist. In section ref(STLWRAPPERS) a general
|
A i(lambda function) is an
|
||||||
approach is discussed allowing the use of members and/or local variables in
|
|
||||||
the context of a function or function object called from generic algorithms.
|
|
||||||
|
|
||||||
But the solutions presented in section ref(STLWRAPPERS) are in fact makeshift
|
|
||||||
solutions that must be used as long as the language doesn't offer lambda
|
|
||||||
functions. A i(lambda function) is an
|
|
||||||
i(anonymous function)hi(function: anonymous). Such a function may be
|
i(anonymous function)hi(function: anonymous). Such a function may be
|
||||||
defined on the spot and exists only during the lifetime of the statement
|
defined on the spot and exists only during the lifetime of the statement
|
||||||
of which it is a part.
|
of which it is a part.
|
||||||
|
|
Loading…
Reference in a new issue