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
@@ -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));
@@ -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,