lib/icu/Init: add class ScopeIcuInit

This commit is contained in:
Max Kellermann
2018-08-02 10:16:56 +02:00
parent b8f3de693f
commit 22192adbc8
2 changed files with 15 additions and 4 deletions

View File

@@ -37,4 +37,18 @@ static inline void IcuFinish() noexcept {}
#endif
class ScopeIcuInit {
public:
ScopeIcuInit() {
IcuInit();
}
~ScopeIcuInit() noexcept {
IcuFinish();
}
ScopeIcuInit(const ScopeIcuInit &) = delete;
ScopeIcuInit &operator=(const ScopeIcuInit &) = delete;
};
#endif