You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@geode.apache.org by GitBox <gi...@apache.org> on 2020/11/12 20:58:01 UTC

[GitHub] [geode-native] gaussianrecurrence commented on a change in pull request #688: GEODE-8614: Add LowMemoryException exceptions

gaussianrecurrence commented on a change in pull request #688:
URL: https://github.com/apache/geode-native/pull/688#discussion_r522421795



##########
File path: cppcache/src/ExceptionTypes.cpp
##########
@@ -23,30 +23,61 @@
 #include "ErrType.hpp"
 #include "util/Log.hpp"
 
-namespace apache {
-namespace geode {
-namespace client {
-
-void setThreadLocalExceptionMessage(std::string exMsg);
-const std::string& getThreadLocalExceptionMessage();
-
-static std::map<GfErrType, std::function<void(std::string, std::string&,
-                                              GfErrType, std::string)>>
-    error_map;
+namespace {
+

Review comment:
       I am glad you noticed. There is a subtle, still pretty good reason for this.
   I've made a gist demonstrating my point: https://gist.github.com/gaussianrecurrence/cda4f6c16b2652e09b539ae9c2bf6e92
   
   Summarizing, basically there is a non-written rule that states: "If you implement free functions that are to be used only within the module implementing them, then put them in a anonymous namespace"
   
   That's done in order to avoid naming conflicts.




----------------------------------------------------------------
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.

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