This is an automated email from the ASF dual-hosted git repository. drdub pushed a commit to branch main in repository https://gitbox.apache.org/repos/asf/uima-uimacpp.git
commit ef3559a17e6695a6514e87ad8a67d8e1ad8e85f2 Author: Pablo Duboue <[email protected]> AuthorDate: Thu Jan 5 06:47:59 2023 -0800 binary_function will be removed soon --- src/cas/uima/cas.hpp | 10 +++++----- src/cas/uima/lowlevel_internal_indexes.hpp | 6 +++++- src/framework/uima/stltools.hpp | 15 +++++++++++++-- src/framework/uima/strtools.hpp | 6 +++++- 4 files changed, 28 insertions(+), 9 deletions(-) diff --git a/src/cas/uima/cas.hpp b/src/cas/uima/cas.hpp index ba492bc..bd88b59 100644 --- a/src/cas/uima/cas.hpp +++ b/src/cas/uima/cas.hpp @@ -1134,7 +1134,7 @@ namespace uima { * @see AnnotationFS */ typedef enum EnIteratorAmbiguity_ { - enAmbiguous, /// Default behaviour: return all annotations, even if several are available for a postion. + enAmbiguous, /// Default behaviour: return all annotations, even if several are available for a position. enUnambiguous, /// return only one annotation for a given position. enNumberOfIteratorAmbiguityElems // must be last in enum } EnIteratorAmbiguity; @@ -1227,7 +1227,7 @@ namespace uima { * * @param crType The type of annotation over which to iterate. crType must be subsumed by type annotation. - * @param enAmbiguous If set to CAS::enAmbiguous calling + * @param ambiguity If set to CAS::enAmbiguous calling * moveToNext/moveToPrevious will alway move the resulting * interator to an annotation that is no longer covered * by the current annotation. @@ -1249,7 +1249,7 @@ namespace uima { * * @throws InvalidIndexObjectException */ - ANIterator subIterator( Type const & crType, EnIteratorAmbiguity enAmbiguous = enAmbiguous ) const; + ANIterator subIterator( Type const & crType, EnIteratorAmbiguity const ambiguity = enAmbiguous ) const; protected: } ; // class AnnotationFS @@ -1352,7 +1352,7 @@ namespace uima { * * @param an The annotatation "under" which the subiterator * iterates - * @param enAmbiguous If set to CAS::enAmbiguous calling + * @param ambiguity If set to CAS::enAmbiguous calling * moveToNext/moveToPrevious will alway move the resulting * interator to an annotation that is no longer covered * by the current annotation. @@ -1373,7 +1373,7 @@ namespace uima { * annotations cover the area.) * @throws InvalidIndexObjectException */ - ANIterator subIterator( AnnotationFS const & an, EnIteratorAmbiguity enAmbiguous = enAmbiguous ) const; + ANIterator subIterator( AnnotationFS const & an, EnIteratorAmbiguity const ambiguity = enAmbiguous ) const; /** * create an iterator over this index such that calling diff --git a/src/cas/uima/lowlevel_internal_indexes.hpp b/src/cas/uima/lowlevel_internal_indexes.hpp index 4bde36e..9abe1c2 100644 --- a/src/cas/uima/lowlevel_internal_indexes.hpp +++ b/src/cas/uima/lowlevel_internal_indexes.hpp @@ -158,7 +158,7 @@ namespace uima { * comparator. * @see SetSingleIndex */ - class UIMA_LINK_IMPORTSPEC IndexComparatorLess : public std::binary_function<TyFS, TyFS, bool> { + class UIMA_LINK_IMPORTSPEC IndexComparatorLess { private: IndexComparator const * iv_cpclComparator; FSHeap const * iv_heap; @@ -169,6 +169,10 @@ namespace uima { assertWithMsg(false, "Default constructor for STL compliance only!"); }; public: + using result_type = bool; + using first_argument_type = TyFS; + using second_argument_type = TyFS; + IndexComparatorLess(IndexComparator const * aComparator, FSHeap const & heap) : iv_cpclComparator(aComparator), diff --git a/src/framework/uima/stltools.hpp b/src/framework/uima/stltools.hpp index ffdce2e..97375fe 100644 --- a/src/framework/uima/stltools.hpp +++ b/src/framework/uima/stltools.hpp @@ -214,6 +214,8 @@ namespace uima { taf_stl_find_sorted(container.begin(), container.end(), element, compare) +// binary_function is deprecated +#if (0) /** STL tool function @@ -325,17 +327,22 @@ namespace uima { } }; +#endif + /** STL tool function */ template <class T> - struct it_second_greater : public std::binary_function<T, T, bool> { + struct it_second_greater { + using result_type = bool; + using first_argument_type = T; + using second_argument_type = T; + bool operator()(const T x, const T y) const { return (*x).second > (*y).second; } }; - /** STL tool class */ @@ -430,6 +437,9 @@ public: } ; //lint !e1509: base class destructor for class 'map' is not virtual +// binary_function is deprecated +#if (0) + /** * STL Tool class with semantics of "less" * applied to elements which are pointers and require dereferencing @@ -443,6 +453,7 @@ public: } ; //lint !e1905: implicit default constructor generated for class 'less_derefptr' +#endif /** Prints all elements in a STL container to stream. diff --git a/src/framework/uima/strtools.hpp b/src/framework/uima/strtools.hpp index f57a5a0..4b769ab 100644 --- a/src/framework/uima/strtools.hpp +++ b/src/framework/uima/strtools.hpp @@ -542,8 +542,12 @@ namespace uima { The class currently supports only single character-based comparision. */ template< class T > - class UIMA_LINK_IMPORTSPEC StringLessI : public std::binary_function< T, T, bool > { + class UIMA_LINK_IMPORTSPEC StringLessI { public: + using result_type = bool; + using first_argument_type = T; + using second_argument_type = T; + bool operator()(const T& x, const T& y) const { if (x.length() == 0) {
