694 | | * '''Version:''' 0.0.1 |
695 | | * '''State:''' Prototype |
696 | | * '''Last upload:''' September 08, 2010 |
697 | | * '''Links:''' [http://sourceforge.net/projects/dbcpp Download] [http://dbcpp.sourceforge.net Documentation] |
698 | | * '''Categories:''' [#Utilities Utilities] |
699 | | * '''Description:''' Allow to define local functions like. |
| 694 | * '''Version:''' 0.1.0 |
| 695 | * '''State:''' Review Ready |
| 696 | * '''Last upload:''' January 03, 2011 |
| 697 | * '''Links:''' [http://www.boostpro.com/vault/index.php?&direction=0&order=&directory=Function%20Objects Boost Vault] [http://contractpp.sourceforge.net/boost-local_0_1_0-818/libs/local/doc/html/index.html Documentation] |
| 698 | * '''Categories:''' [#FunctionObjectsAndHigher-orderProgramming Function Objects And Higher-order Programming] |
| 699 | * '''Description:''' Local functions, local blocks, and local exits. |
| 700 | |
| 701 | Local functions are a form of information hiding and are useful for dividing procedural tasks into subtasks which are only meaningful locally, avoiding cluttering other parts of the program with functions, variables, etc unrelated to those parts. Local functions therefore complement other structuring possibilities such as namespaces and classes. |
| 702 | |
| 703 | * Local functions can access, or better bind, any of the variables from the enclosing scope. Furthermore, local functions defined within a member function can bind the enclosing object this. |
| 704 | * The local function body is programmed using the usual C++ syntax. |
| 705 | * Local functions can be passed as template parameters (so they can be conveniently passed to STL algorithms, etc). |
| 706 | * However, local functions must be defined within a declarative context (e.g., at a point in the code where local variables can be declared) thus they cannot be defined within an expression. |
| 707 | |
| 708 | In addition to local functions, this library also supports the following features: |
| 709 | |
| 710 | * Local blocks which define blocks of code that bind variables from the enclosing scope. Local blocks allow programmers to bind variables as constants (constant binding) so to prevent local chunks of code from modifying selected variables. |
| 711 | * Local exits which define blocks of code that are executed when the enclosing scope is exited (again with support for constant binding and binding of the object this). |