Merged ScopeExit (improved), LocalFunction (new), Functional/OverloadedFunction (new), and Utility/IdentityType (new) from trunk into release branch.

[SVN r78564]
This commit is contained in:
Lorenzo Caminiti
2012-05-24 01:35:04 +00:00
parent fece1283e9
commit 290103d629
168 changed files with 4145 additions and 1895 deletions

View File

@@ -7,6 +7,8 @@
#include <boost/local_function.hpp>
#include <boost/noncopyable.hpp>
#include <boost/typeof/typeof.hpp>
#include BOOST_TYPEOF_INCREMENT_REGISTRATION_GROUP()
#include <cassert>
//[noncopyable_local_function
@@ -14,12 +16,13 @@ struct n: boost::noncopyable {
int i;
n(int _i): i(_i) {}
};
BOOST_TYPEOF_REGISTER_TYPE(n) // Register for `bind& x` below.
int main() {
int main(void) {
n x(-1);
void BOOST_LOCAL_FUNCTION(const bind& x) { // OK: No copy
assert( x.i == -1 ); // and constant.
assert(x.i == -1); // and constant.
} BOOST_LOCAL_FUNCTION_NAME(f)
f();