flashlight / text

Text utilities, including beam search decoding, tokenizing, and more, built for use in Flashlight.
MIT License
64 stars 15 forks source link

Include <string> in Trie.cpp #10

Closed mthrok closed 2 years ago

mthrok commented 2 years ago

Summary: std::to_string is defined in <string> header. https://en.cppreference.com/w/cpp/string/basic_string/to_string

gcc and clang are fine without the header, but cl.exe is not.

C:\...\flashlight\lib\text\decoder\Trie.cpp(32): error C2039: 'to_string': is not a member of 'std'
C:\...\flashlight\lib\text\decoder\Trie.cpp(32): error C3861: 'to_string': identifier not found
C:\...\flashlight\lib\text\decoder\Trie.cpp(31): error C2512: 'std::out_of_range': no appropriate default constructor available
C:\...\flashlight\lib\text\decoder\Trie.cpp(32): note: No constructor could take the source type, or constructor overload resolution was ambiguous
C:\...\flashlight\lib\text\decoder\Trie.cpp(54): error C2039: 'to_string': is not a member of 'std'
C:\...\flashlight\lib\text\decoder\Trie.cpp(54): error C3861: 'to_string': identifier not found
C:\...\flashlight\lib\text\decoder\Trie.cpp(53): error C2512: 'std::out_of_range': no appropriate default constructor available
C:\...\flashlight\lib\text\decoder\Trie.cpp(54): note: No constructor could take the source type, or constructor overload resolution was ambiguous

Differential Revision: D38194039

facebook-github-bot commented 2 years ago

This pull request was exported from Phabricator. Differential Revision: D38194039