You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@doris.apache.org by "github-actions[bot] (via GitHub)" <gi...@apache.org> on 2023/04/19 13:32:21 UTC

[GitHub] [doris] github-actions[bot] commented on a diff in pull request #18830: [refactor](exceptionsafe) disallow call new method explicitly

github-actions[bot] commented on code in PR #18830:
URL: https://github.com/apache/doris/pull/18830#discussion_r1171350657


##########
be/src/common/smart_ptr_helper.h:
##########
@@ -0,0 +1,51 @@
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements.  See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership.  The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License.  You may obtain a copy of the License at
+//
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied.  See the License for the
+// specific language governing permissions and limitations
+// under the License.
+
+#pragma once
+#include <memory>
+
+// All object should inherit from this class, like
+// class A  {
+// DISALLOW_EXPILICT_NEW(A);
+// };
+//
+// Then the caller could not call new A() any more, has to call A::create_shared(...)
+// or A::create_unique(...), then we could make sure all object in our project is shared
+// pointer.
+// But could call A a(...);
+
+// A macro to disallow the copy constructor and operator= functions
+// This should be used in the private: declarations for a class
+//
+// Not use template like cowhelper to implements this feature because it has problem
+// during inherits
+// TODO try to allow make_unique
+#define DISALLOW_EXPILICT_NEW(TypeName)                                                     \

Review Comment:
   warning: macro is not used [clang-diagnostic-unused-macros]
   ```cpp
   #define DISALLOW_EXPILICT_NEW(TypeName)                                                     \
           ^
   ```
   



-- 
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: commits-unsubscribe@doris.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org