diff --git a/mecab/src/dictionary.cpp b/mecab/src/dictionary.cpp index 87c377a..20fa697 100644 --- a/mecab/src/dictionary.cpp +++ b/mecab/src/dictionary.cpp @@ -64,6 +64,15 @@ int progress_bar_darts(size_t current, size_t total) { return progress_bar("emitting double-array", current, total); } +#if defined(__cplusplus) && __cplusplus >= 201103L +template +struct pair_1st_cmp: public std::binary_function { + bool operator()(const std::pair &x1, + const std::pair &x2) { + return x1.first < x2.first; + } +}; +#else template struct pair_1st_cmp: public std::function { bool operator()(const std::pair &x1, @@ -71,6 +80,7 @@ struct pair_1st_cmp: public std::function { return x1.first < x2.first; } }; +#endif } // namespace bool Dictionary::open(const char *file, const char *mode) {