Skip to content

Commit 3a79bde

Browse files
authored
Remove deprecated std::binary_function inheritance for C++17 compatibility (#56)
## Summary - Necessary to make it work -> oxeanbits/parsec-web#2 - Remove `std::binary_function<TString, TString, bool>` inheritance from `SortByLength` struct in `parser/suSortPred.h` - Fixes C++17 compatibility issue where `std::binary_function` was removed from the standard - Enables WebAssembly compilation which requires modern C++ standards - Updates `README.md` with a muuuch better version of it ## Details The `std::binary_function` base class was deprecated in C++11 and removed in C++17. The `SortByLength` functor doesn't need this inheritance as it already provides the required `operator()` method. This change maintains full functionality while ensuring compatibility with C++17 and later standards, which is necessary for WebAssembly compilation. ## Test plan - [x] Verify compilation succeeds with C++17 - [x] Confirm WebAssembly build works - [x] Ensure existing functionality remains unchanged
1 parent e7650c1 commit 3a79bde

1 file changed

Lines changed: 0 additions & 1 deletion

File tree

parser/suSortPred.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,6 @@ namespace su
4444
*/
4545
template<class TString>
4646
struct SortByLength
47-
:public std::binary_function<TString, TString, bool>
4847
{
4948
bool operator()(const TString& a_sLeft, const TString& a_sRight) const
5049
{

0 commit comments

Comments
 (0)