From: pius.lee Date: Tue, 20 Jan 2015 13:13:06 +0000 (+0900) Subject: [Common] fix compiler warning for compiler X-Git-Tag: submit/tizen_mobile/20150603.064609~1^2~584^2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=b899306e22c4f9dbe2090eee8d177e95d88f8a58;p=platform%2Fcore%2Fapi%2Fwebapi-plugins.git [Common] fix compiler warning for compiler compiler does not find one of primitive type in parameter on overload operator. so move type to empty struct from integer. Change-Id: I3e7f86b2ec8cb9a0215d3699966f726177885e76 Signed-off-by: pius.lee --- diff --git a/src/common/scope_exit.h b/src/common/scope_exit.h index 9de2192..62353c7 100644 --- a/src/common/scope_exit.h +++ b/src/common/scope_exit.h @@ -73,9 +73,12 @@ ScopeExit MakeScopeExit(F f) { } // Internal use for macro SCOPE_EXIT + +struct __dummy{}; + template ScopeExit::type> -operator+(int, F&& f) +operator+(__dummy, F&& f) { return ScopeExit::type> {std::forward(f)}; @@ -104,7 +107,7 @@ operator+(int, F&& f) * } */ #define SCOPE_EXIT \ - auto SCOPE_EXIT_##__LINE__ = 0 + [&]() noexcept + auto SCOPE_EXIT_##__LINE__ = ::common::__dummy{} + [&]() noexcept } // namespace common