This repository was archived by the owner on Mar 19, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 4.8k
Backward compatibility with C++11 #1357
Copy link
Copy link
Open
Description
Issue
The 'Requirements' section of the documentation says:
_Generally, fastText builds on modern Mac OS and Linux distributions. Since it uses some C++11 features, it requires a compiler with good C++11 support. These include :
(g++-4.7.2 or newer) or (clang-3.3 or newer)_
Recent performance improvements use C++17 features (specifically the use of std::string_view). Reference issue - Predict 1.9-4.2x faster (#1341)
Action
Although C++17 is now a prerequisite, fastText can still compile on C++11 with a few minor modifications, but with degraded performance. To do this:
- Dependency on string_view is restored using a type definition on C++11.
- Fix build errors caused by use of static_assert
- Add instructions in the README file for modifications to makefile to build on C++11
The feature is desirable because legacy systems that use fastText (since 2015) might continue to use C++11.
Recommendation
- Add string_view to dictionary for fast lookup (commit ffee8e4) incorrectly replaces a pass by reference by a pass by value on several constant argument. Use a pass by reference instead.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels