PragmaTwice commented on code in PR #781:
URL: https://github.com/apache/incubator-kvrocks/pull/781#discussion_r949364315


##########
src/util.h:
##########
@@ -71,8 +76,14 @@ uint64_t GetTimeStampUS(void);
 // define std::make_unique in c++14
 // refer to https://en.cppreference.com/w/cpp/memory/unique_ptr/make_unique
 template <typename T, typename... Args>
-std::unique_ptr<T> MakeUnique(Args&& ... args) {
+inline std::unique_ptr<T> MakeUnique(Args &&...args) {
   return std::unique_ptr<T>(new T(std::forward<Args>(args)...));
 }
 
-}  // namespace Util
+// define std::make_shared in c++14
+// refer to https://en.cppreference.com/w/cpp/memory/shared_ptr/make_shared
+template <typename T, typename... Args>
+inline std::shared_ptr<T> MakeShared(Args &&...args) {
+  return std::shared_ptr<T>(new T(std::forward<Args>(args)...));
+}
+} // namespace Util

Review Comment:
   `std::make_shared` is in c++11, not c++14, so I think we do not need it.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to