Ver Fonte

fix build error

Summary: Fix the "ISO C++ forbids in-class initialization of non-const static member" build error.

Reviewed By: cpuhrsch

Differential Revision: D5124035

fbshipit-source-id: 1c715a252a9cb1ef2623ef8e7d77791f7f05bae8
Edouard Grave há 8 anos atrás
pai
commit
8ceaa133d8
2 ficheiros alterados com 2 adições e 2 exclusões
  1. 1 1
      src/dictionary.cc
  2. 1 1
      src/dictionary.h

+ 1 - 1
src/dictionary.cc

@@ -25,7 +25,7 @@ const std::string Dictionary::EOW = ">";
 
 Dictionary::Dictionary(std::shared_ptr<Args> args) : args_(args),
   word2int_(MAX_VOCAB_SIZE, -1), size_(0), nwords_(0), nlabels_(0),
-  ntokens_(0) {}
+  ntokens_(0), pruneidx_size_(-1) {}
 
 int32_t Dictionary::find(const std::string& w) const {
   return find(w, hash(w));

+ 1 - 1
src/dictionary.h

@@ -53,7 +53,7 @@ class Dictionary {
     int32_t nlabels_;
     int64_t ntokens_;
 
-    int64_t pruneidx_size_ = -1;
+    int64_t pruneidx_size_;
     std::unordered_map<int32_t, int32_t> pruneidx_;
     void addWordNgrams(
         std::vector<int32_t>& line,