[pepper-str] make a function in header inline (#7043)
author윤현식/On-Device Lab(SR)/Principal Engineer/삼성전자 <hyunsik.yoon@samsung.com>
Fri, 30 Aug 2019 02:41:38 +0000 (11:41 +0900)
committer박종현/On-Device Lab(SR)/Staff Engineer/삼성전자 <jh1302.park@samsung.com>
Fri, 30 Aug 2019 02:41:38 +0000 (11:41 +0900)
* [pepper-str] make a function in header inline

This adds `inline` keyword to `str_impl(...)` function in header.

Signed-off-by: Hyun Sik Yoon <hyunsik.yoon@samsung.com>
* added inline to all str_impl

compiler/pepper-str/include/pepper/str.h

index d4ea7c1..0ddacb5 100644 (file)
@@ -29,16 +29,19 @@ namespace details
 
 template <typename... Arg> void str_impl(std::ostream &os, Arg &&... args);
 
-template <> void str_impl(std::ostream &os)
+template <> inline void str_impl(std::ostream &os)
 {
   // DO NOTHING
   return;
 }
 
-template <typename Arg> void str_impl(std::ostream &os, Arg &&arg) { os << std::forward<Arg>(arg); }
+template <typename Arg> inline void str_impl(std::ostream &os, Arg &&arg)
+{
+  os << std::forward<Arg>(arg);
+}
 
 template <typename Arg, typename... Args>
-void str_impl(std::ostream &os, Arg &&arg, Args &&... args)
+inline void str_impl(std::ostream &os, Arg &&arg, Args &&... args)
 {
   str_impl(os, std::forward<Arg>(arg));
   str_impl(os, std::forward<Args>(args)...);