|
libpsynth 0.2.1
|
Time-stamp: <2011-03-17 00:19:22 raskolnikov> More...


Go to the source code of this file.
Classes | |
| class | psynth::base::scope_guard_impl_base |
| class | psynth::base::scope_guard_impl< Fun > |
Namespaces | |
| namespace | psynth |
| namespace | psynth::base |
Defines | |
| #define | PSYNTH_CONCATENATE_DIRECT(s1, s2) s1##s2 |
| #define | PSYNTH_CONCATENATE(s1, s2) PSYNTH_CONCATENATE_DIRECT(s1, s2) |
| #define | PSYNTH_ANONYMOUS_VARIABLE(str) PSYNTH_CONCATENATE(str, __LINE__) |
| #define | PSYNTH_ON_BLOCK_EXIT(f) ::psynth::base::scope_guard PSYNTH_ANONYMOUS_VARIABLE(scope_guard) = ::psynth::base::make_guard(f); ::psynth::base::ignore_unused_variable_warning (PSYNTH_ANONYMOUS_VARIABLE(scope_guard)) |
Typedefs | |
| typedef const scope_guard_impl_base & | psynth::base::scope_guard |
Functions | |
| template<typename Fun > | |
| scope_guard_impl< Fun > | psynth::base::make_guard (const Fun &fun) |
Time-stamp: <2011-03-17 00:19:22 raskolnikov>
Scope guard for calling a function on scope exit. Specially useful when writting C wrappers.
Based on the well known Loki::ScopeGuard library developed by Andrei Alexandrescu and throughly described here but adapted for easier integration with C++0x lambdas.
| #define PSYNTH_ANONYMOUS_VARIABLE | ( | str | ) | PSYNTH_CONCATENATE(str, __LINE__) |
| #define PSYNTH_CONCATENATE | ( | s1, | |
| s2 | |||
| ) | PSYNTH_CONCATENATE_DIRECT(s1, s2) |
| #define PSYNTH_CONCATENATE_DIRECT | ( | s1, | |
| s2 | |||
| ) | s1##s2 |
| #define PSYNTH_ON_BLOCK_EXIT | ( | f | ) | ::psynth::base::scope_guard PSYNTH_ANONYMOUS_VARIABLE(scope_guard) = ::psynth::base::make_guard(f); ::psynth::base::ignore_unused_variable_warning (PSYNTH_ANONYMOUS_VARIABLE(scope_guard)) |
1.7.4