[Common] fix compiler warning for compiler
authorpius.lee <pius.lee@samsung.com>
Tue, 20 Jan 2015 13:13:06 +0000 (22:13 +0900)
committerpius.lee <pius.lee@samsung.com>
Tue, 20 Jan 2015 13:13:06 +0000 (22:13 +0900)
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 <pius.lee@samsung.com>
src/common/scope_exit.h

index 9de2192..62353c7 100644 (file)
@@ -73,9 +73,12 @@ ScopeExit<F> MakeScopeExit(F f) {
 }
 
 // Internal use for macro SCOPE_EXIT
+
+struct __dummy{};
+
 template <typename F>
 ScopeExit<typename std::decay<F>::type>
-operator+(int, F&& f)
+operator+(__dummy, F&& f)
 {
   return ScopeExit<typename std::decay<F>::type>
   {std::forward<F>(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