[ 
https://issues.apache.org/jira/browse/GEODE-8340?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17156981#comment-17156981
 ] 

ASF GitHub Bot commented on GEODE-8340:
---------------------------------------

pdxcodemonkey commented on a change in pull request #625:
URL: https://github.com/apache/geode-native/pull/625#discussion_r453936057



##########
File path: cppcache/include/geode/DataInput.hpp
##########
@@ -313,7 +313,53 @@ class APACHE_GEODE_EXPORT DataInput {
         // empty string
         break;
       // TODO: What's the right response here?
-      default:
+      case internal::DSCode::FixedIDDefault:

Review comment:
       Just gonna leave this here, cause I spent the time & effort to figure it 
out.  Probably slightly better performance than the if-else approach, but I'm 
still not sure about readability:
   
   ```
     template <class CharT = char, class... Tail>
     inline std::basic_string<CharT, Tail...> readString() {
       std::basic_string<CharT, Tail...> value;
       std::map<internal::DSCode, std::function<void(std::string&)> > readers;
   
       readers.insert(std::make_pair(
           internal::DSCode::CacheableString,
           [=](std::string& val) { this->readJavaModifiedUtf8(val); }));
   
       readers.insert(
           std::make_pair(internal::DSCode::CacheableStringHuge,
                          [=](std::string& val) { this->readUtf16Huge(val); }));
   
       readers.insert(
           std::make_pair(internal::DSCode::CacheableASCIIString,
                          [=](std::string& val) { this->readAscii(val); }));
   
       readers.insert(
           std::make_pair(internal::DSCode::CacheableASCIIStringHuge,
                          [=](std::string& val) { this->readAsciiHuge(val); }));
   
       auto type = static_cast<internal::DSCode>(read());
       auto it = readers.find(static_cast<internal::DSCode>(read()));
   
       if (it != readers.end()) {
         it->second(value);
       }
       return value;
     }
   
   ```




----------------------------------------------------------------
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:
[email protected]


> Enforce Switch compiler warnings as errors
> ------------------------------------------
>
>                 Key: GEODE-8340
>                 URL: https://issues.apache.org/jira/browse/GEODE-8340
>             Project: Geode
>          Issue Type: Improvement
>          Components: native client
>            Reporter: Michael Oleske
>            Priority: Major
>
> Given I compile the code without exempting no-switch-enum and 
> no-implicit-fallthrough and no-covered-switch-default
> Then it should compile
> Note - was marked as a todo, seems reasonable to tackle all these at once



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to