| 1 |
#include <iostream> |
| 2 |
#include <cstdio> |
| 3 |
|
| 4 |
using namespace std; |
| 5 |
|
| 6 |
class xml_document { |
| 7 |
// Non-copyable semantics => functions private and not defined |
| 8 |
xml_document(const xml_document&); |
| 9 |
xml_document& operator=(const xml_document&); |
| 10 |
public: |
| 11 |
xml_document() {} |
| 12 |
// Move semantics support |
| 13 |
xml_document& operator=(xml_document&& rhs); |
| 14 |
}; |
| 15 |
|
| 16 |
xml_document& xml_document::operator=(xml_document&& rhs) { |
| 17 |
return *this; // just a dummy implementation |
| 18 |
} |
| 19 |
|
| 20 |
int main() { |
| 21 |
printf ("StdCxx11: Handling of language features introduced with C++11\n"); |
| 22 |
printf ("=============================================================\n"); |
| 23 |
xml_document d1, d2; |
| 24 |
d1 = static_cast<xml_document&&>(d2); // move semantics |
| 25 |
printf ("=============================================================\n"); |
| 26 |
} |
| 27 |
|
| 28 |
aspect ExecTracer { |
| 29 |
advice execution ("% ...::%(...)" && !"% main(...)") : before () { |
| 30 |
printf ("before %s\n", JoinPoint::signature ()); |
| 31 |
} |
| 32 |
advice execution ("% ...::%(...)" && !"% main(...)") : around () { |
| 33 |
tjp->proceed (); |
| 34 |
printf ("after %s\n", JoinPoint::signature ()); |
| 35 |
} |
| 36 |
}; |