📄 scopeguard.hpp
字号:
/** * @file ScopeGuard.hpp * @brief ScopeGuard,泥偶做的一些改动,在namespace中声明 * @author 泥偶 * @since 2003-10-15 * @date 2003-10-18 * @note 这个是从 http://www.c-view.org/journal/005/gp_aa.htm 弄来的好东东 */#ifndef SCOPEGUARD_HPP#define SCOPEGUARD_HPPnamespace x{ #include "ScopeGuard.h" #ifdef __GNUC__ // 重新定义ON_BLOCK_EXIT和ON_BLOCK_EXIT_OBJ,避免编译器抱怨unused variable #undef ON_BLOCK_EXIT #define ON_BLOCK_EXIT ScopeGuard __attribute__ ((__unused__)) \ ANONYMOUS_VARIABLE(scopeGuard) = MakeGuard #undef ON_BLOCK_EXIT_OBJ #define ON_BLOCK_EXIT_OBJ ScopeGuard __attribute__ ((__unused__)) \ ANONYMOUS_VARIABLE(scopeGuard) = MakeObjGuard #endif // __GNUC__} // namespace x#endif // ifndef SCOPEGUARD_HPP
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -