Fix compiling problems under VS2017.3.

1. WordIterator's operator== and operator!= must take const WordIterator& as parameter type.
2. OpenMP doesn't work with new two phase lookups. Need to disable twoPhase.
pull/1385/head
Minmin Gong 2017-08-14 21:51:59 -07:00
parent dab0985994
commit b26fea4cf5
2 changed files with 8 additions and 2 deletions

View File

@ -148,6 +148,12 @@ find_package(OpenMP)
if (OPENMP_FOUND)
SET (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${OpenMP_C_FLAGS}")
SET (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${OpenMP_CXX_FLAGS}")
IF(MSVC)
IF(MSVC_VERSION GREATER 1910)
SET (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /Zc:twoPhase-")
ENDIF()
ENDIF()
endif()
CONFIGURE_FILE(

View File

@ -95,8 +95,8 @@ struct WordIterator: public std::iterator<std::input_iterator_tag, const char*>
end_ = other.end_;
return *this;
}
bool operator==(WordIterator &other) const { return start_ == other.start_; }
bool operator!=(WordIterator &other) const { return start_ != other.start_; }
bool operator==(const WordIterator &other) const { return start_ == other.start_; }
bool operator!=(const WordIterator &other) const { return start_ != other.start_; }
WordIterator &operator++() {
start_ += strcspn(start_, whitespace);
start_ += strspn(start_, whitespace);