Changeset 4339


Ignore:
Timestamp:
Apr 15, 2023, 12:35:22 PM (5 months ago)
Author:
Peter
Message:

fixes #998

Location:
trunk
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • trunk/NEWS

    r4326 r4339  
    44
    55version 0.21 (released NOT YET)
     6  - A number of classes no longer inherit from std::unary_function (or
     7    std::binary_function), but typedef argument_type
     8    (first_argument_type or second_argument_type) and result_type
     9    itself instead (ticket #998).
    610  - htslib 1.10 (or newer) is now required (ticket #991)
    711  - GSL 2.2 (or newer) is now required (ticket #983)
  • trunk/yat/omic/BamRead.h

    r4207 r4339  
    500500   */
    501501  struct BamLessPos
    502     : public std::binary_function<const BamRead&, const BamRead&, bool>
    503502  {
     503    /// first argument is a const BamRead&
     504    typedef const BamRead& first_argument_type;
     505    /// second argument is a const BamRead&
     506    typedef const BamRead& second_argument_type;
     507    /// Functor returns a \c bool
     508    typedef bool result_type;
     509
    504510    /**
    505511       \return true if lhs tid is less than rhs tid; or tid
     
    521527   */
    522528  struct BamLessEnd
    523     : public std::binary_function<const BamRead&, const BamRead&, bool>
    524529  {
     530    /// first argument is a const BamRead&
     531    typedef const BamRead& first_argument_type;
     532    /// second argument is a const BamRead&
     533    typedef const BamRead& second_argument_type;
     534    /// Functor returns a \c bool
     535    typedef bool result_type;
     536
    525537    /**
    526538       \return true if lhs tid is less than rhs tid; or tid
     
    541553   */
    542554  struct BamLessName
    543     : public std::binary_function<const BamRead&, const BamRead&, bool>
    544555  {
     556    /// first argument is a const BamRead&
     557    typedef const BamRead& first_argument_type;
     558    /// second argument is a const BamRead&
     559    typedef const BamRead& second_argument_type;
     560    /// Functor returns a bool
     561    typedef bool result_type;
     562
    545563    /**
    546564       \return \c true if lhs query name is less than rhs query name
  • trunk/yat/omic/BamReadFilter.h

    r3999 r4339  
    5555     \since new in yat 0.11
    5656   */
    57   class BamReadFilter : public std::unary_function<const BamRead&, bool>
     57  class BamReadFilter
    5858  {
    5959  public:
     60    /// Functor takes a const BamRead&
     61    typedef const BamRead& argument_type;
     62    /// Functor returns \c bool
     63    typedef bool result_type;
     64
    6065    /**
    6166       Create a functor which accepts reads with mapping quality \a
  • trunk/yat/omic/BamWriteIterator.h

    r4252 r4339  
    4141     \since New in yat 0.10
    4242   */
    43   class BamWriter : public std::unary_function<const BamRead&, void>
     43  class BamWriter
    4444  {
    4545  public:
     46    /// \c argument_type is const BamRead&
     47    typedef const BamRead& argument_type;
     48    /// Functor returns nothing
     49    typedef void result_type;
     50
    4651    /**
    4752       \brief Default constructor
  • trunk/yat/omic/Codon.h

    r3487 r4339  
    143143     \since New in yat 0.7
    144144   */
    145   struct AminoAcidEqual : public std::binary_function<Codon, Codon, bool>
     145  struct AminoAcidEqual
    146146  {
     147    /// \c first_argument_type is Codon
     148    typedef Codon first_argument_type;
     149    /// \c second_argument_type is Codon
     150    typedef Codon second_argument_type;
     151    /// \c result_type is \c bool
     152    typedef bool result_type;
     153
    147154    /// \return \c true \a lhs and \a rhs translates to same amino acid
    148155    bool operator()(const Codon& lhs, const Codon& rhs) const;
  • trunk/yat/utility/OstreamIterator.h

    r4252 r4339  
    4141    /// \internal class used in OstreamIterator
    4242    template<typename T>
    43     class OstreamIteratorFunc : public std::unary_function<const T&, void>
     43    class OstreamIteratorFunc
    4444    {
    4545    public:
  • trunk/yat/utility/Segment.h

    r4338 r4339  
    330330   */
    331331  template<typename T, class Compare>
    332   struct SegmentCompare :
    333     public std::binary_function<Segment<T,Compare>, Segment<T,Compare>, bool>
    334   {
     332  struct SegmentCompare
     333  {
     334    /// \c first_argument_type is \c Segment<T,Compare>
     335    typedef Segment<T,Compare> first_argument_type;
     336    /// \c second_argument_type is \c Segment<T,Compare>
     337    typedef Segment<T,Compare> second_argument_type;
     338    /// \c result_type is \c bool
     339    typedef bool result_type;
     340
    335341    /**
    336342       \see compare(const Segment<T,Compare>&, const Segment<T,Compare>&)
  • trunk/yat/utility/stl_utility.h

    r4324 r4339  
    8484  */
    8585  template<typename T>
    86   struct abs : std::unary_function<T, T>
    87   {
     86  struct abs
     87  {
     88    /// \c argument_type is \c T
     89    typedef T argument_type;
     90
     91    /// \c result_type is \c T
     92    typedef T result_type;
     93
    8894    /**
    8995       \return absolute value
     
    120126   */
    121127  template<typename Pointer>
    122   struct Dereferencer :
    123     public std::unary_function<Pointer,
    124                                typename std::iterator_traits<Pointer>::reference>
    125   {
     128  struct Dereferencer
     129  {
     130    /// \c argument_type is \c Pointer
     131    typedef Pointer argument_type;
     132    /// \c result_type
     133    typedef typename std::iterator_traits<Pointer>::reference result_type;
     134
    126135    /**
    127136       \brief constructor
     
    176185   */
    177186  template<class F, class G, class H>
    178   class compose_f_gx_hy :
    179     public std::binary_function<typename G::argument_type,
    180                                 typename H::argument_type,
    181                                 typename F::result_type>
     187  class compose_f_gx_hy
    182188  {
    183189  public:
     190    /// \c first_argument_type is G's \c argument_type
     191    typedef typename G::argument_type first_argument_type;
     192    /// \c second_argument_type is H's \c argument_type
     193    typedef typename H::argument_type second_argument_type;
     194    /// \c result_type is F's \c result_type
     195    typedef typename F::result_type result_type;
     196
    184197    /**
    185198       \brief default constructor
     
    248261   */
    249262  template<class F, class G>
    250   class compose_f_gxy :
    251     public std::binary_function<typename G::first_argument_type,
    252                                 typename G::second_argument_type,
    253                                 typename F::result_type>
     263  class compose_f_gxy
    254264  {
    255265  public:
     266    /// \c first_argument_type is G's first_argument_type
     267    typedef typename G::first_argument_type first_argument_type;
     268    /// \c second_argument_type is G's second_argument_type
     269    typedef typename G::second_argument_type second_argument_type;
     270    /// \c result_type is F's result_type
     271    typedef typename F::result_type result_type;
     272
    256273    /**
    257274       \brief default constructor
     
    324341   */
    325342  template<class F, class G>
    326   class compose_f_gx : public std::unary_function<typename G::argument_type,
    327                                                   typename F::result_type>
     343  class compose_f_gx
    328344  {
    329345  public:
     346    /// \c argument_type is G's \c argument_type
     347    typedef typename G::argument_type argument_type;
     348    /// \c result_type is G's \c result_type
     349    typedef typename F::result_type result_type;
     350
    330351    /**
    331352       \brief default constructor
     
    400421   */
    401422  template<class F, class G, class H>
    402   class compose_f_gx_hx : public std::unary_function<typename G::argument_type,
    403                                                      typename F::result_type>
     423  class compose_f_gx_hx
    404424  {
    405425  public:
     426    /// \c argument_type is G's \c argument_type
     427    typedef typename G::argument_type argument_type;
     428    /// \c result_type is F's \c result_type
     429    typedef typename F::result_type result_type;
     430
    406431    /**
    407432       \brief default constructor
     
    457482  */
    458483  template<typename T>
    459   struct Exp : std::unary_function<T, T>
    460   {
     484  struct Exp
     485  {
     486    /// \c argument_type is \c T
     487    typedef T argument_type;
     488    /// \c result_type is \c T
     489    typedef T result_type;
     490
    461491    /**
    462492       \return exponentiated value
     
    472502   */
    473503  template<typename T>
    474   struct Identity : public std::unary_function<T, T>
    475   {
     504  struct Identity
     505  {
     506    /// \c argument_type is \c T
     507    typedef T argument_type;
     508    /// \c result_type is \c T
     509    typedef T result_type;
    476510    /// \return \a arg
    477511    T operator()(T arg) const { return arg; }
     
    622656  */
    623657  template<typename T>
    624   struct less_nan : std::binary_function<T, T, bool>
    625   {
     658  struct less_nan
     659  {
     660    /// \c first_argument_type is \c T
     661    typedef T first_argument_type;
     662    /// \c second_argument_type is \c T
     663    typedef T second_argument_type;
     664    /// \c result_type is \c bool
     665    typedef bool result_type;
     666
    626667    /**
    627668       \return \c true if x is less than y. NaNs are treated as a number
     
    645686  template<>
    646687  struct less_nan<DataWeight>
    647     : std::binary_function<DataWeight, DataWeight, bool>
    648   {
     688  {
     689    /// \c first_argument_type is \c DataWeight
     690    typedef DataWeight first_argument_type;
     691    /// \c second_argument_type is \c DataWeight
     692    typedef DataWeight second_argument_type;
     693    /// \c result_type is \c bool
     694    typedef bool result_type;
     695
    649696    /**
    650697       \return less_nan<double>(x.data(), y.data())
     
    666713  */
    667714  template<typename T>
    668   class Log : std::unary_function<T, T>
     715  class Log
    669716  {
    670717  public:
     718    /// \c argument_type is \c T
     719    typedef T argument_type;
     720    /// \c result_type is \c T
     721    typedef T result_type;
     722
    671723    /**
    672724       Default constructor using natural base \f$ e \f$
Note: See TracChangeset for help on using the changeset viewer.