Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix/remove deprecation warnings gcc12 #8

Merged
merged 7 commits into from
Oct 27, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
lmao3
  • Loading branch information
amatria committed Oct 27, 2022
commit b6cafa79c7f0d1cf450c04d69f9d17f097c531a9
2 changes: 1 addition & 1 deletion include/seqan/file/string_external.h
Original file line number Diff line number Diff line change
Expand Up @@ -1335,7 +1335,7 @@ namespace seqan
pf.pageNo = -1; // cut back link
}

struct testIODone : public std::unary_function<TPageFrame&,bool>
struct testIODone : std::function<bool(TPageFrame&)>
{
String &me;
testIODone(String &_me): me(_me) {}
Expand Down
5 changes: 3 additions & 2 deletions include/seqan/graph_algorithms/graph_algorithm_heap_tree.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@
#ifndef SEQAN_HEADER_GRAPH_ALGORITHM_HEAP_TREE_H
#define SEQAN_HEADER_GRAPH_ALGORITHM_HEAP_TREE_H

#include <functional>

namespace seqan
{

Expand Down Expand Up @@ -321,8 +323,7 @@ heapSort(TITBegin itBeg,
//////////////////////////////////////////////////////////////////////////////

template<typename TKey, typename TValue, typename TPredicate>
struct LessPairI2WithFunctor :
public std::unary_function<Pair<TKey, TValue>, bool>
struct LessPairI2WithFunctor : std::function<bool(Pair<TKey, TValue>,Pair<TKey, TValue>)>
{
inline bool
operator() (Pair<TKey, TValue> const& a1, Pair<TKey, TValue> const& a2) {
Expand Down
4 changes: 3 additions & 1 deletion include/seqan/graph_algorithms/kruskal.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@
#ifndef INCLUDE_SEQAN_GRAPH_ALGORITHMS_KRUSKAL_H_
#define INCLUDE_SEQAN_GRAPH_ALGORITHMS_KRUSKAL_H_

#include <functional>

namespace seqan {

// ============================================================================
Expand All @@ -60,7 +62,7 @@ namespace seqan {
// ----------------------------------------------------------------------------

template <typename TWeight, typename TPair>
struct LessPairI1_ : public std::unary_function<Pair<TWeight, TPair>, bool>
struct LessPairI1_ : std::function<bool(Pair<TWeight, TPair>,Pair<TWeight, TPair>)>
{
bool operator() (Pair<TWeight, TPair> const & a1,
Pair<TWeight, TPair> const & a2) const
Expand Down
8 changes: 5 additions & 3 deletions include/seqan/index/index_base.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@
#ifndef SEQAN_HEADER_INDEX_BASE_H
#define SEQAN_HEADER_INDEX_BASE_H

#include <functional>

//#define SEQAN_TEST_INDEX

namespace seqan
Expand Down Expand Up @@ -337,7 +339,7 @@ template <
};

// less function to search in sorted list for fibre id
struct FibreLess: public std::binary_function<FibreRecord, unsigned, bool>
struct FibreLess: std::function<bool(FibreRecord,unsigned)>
{ // functor for operator>
inline bool operator()(FibreRecord const & _Left, unsigned const Right_) const
{ // apply operator> to operands
Expand Down Expand Up @@ -643,7 +645,7 @@ template <
// globalize functor

template <typename InType, typename TLimitsString, typename Result = typename Value<TLimitsString>::Type>
struct FunctorGlobalize : public std::unary_function<InType,Result>
struct FunctorGlobalize : std::function<Result(InType)>
{
TLimitsString const * limits;

Expand All @@ -657,7 +659,7 @@ template <
};

template <typename InType, typename Result>
struct FunctorGlobalize<InType, Nothing, Result> : public std::unary_function<InType,InType>
struct FunctorGlobalize<InType, Nothing, Result> : std::function<InType(InType)>
{
FunctorGlobalize() {}
FunctorGlobalize(Nothing const &) {}
Expand Down
3 changes: 2 additions & 1 deletion include/seqan/misc/set.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
#define SEQAN_HEADER_MISC_SET_H

#include <set>
#include<functional>
#include <seqan/misc/base.h>

//////////////////////////////////////////////////////////////////////////////
Expand Down Expand Up @@ -370,7 +371,7 @@ namespace seqan


template <typename TElement>
struct SetLess_ : public std::binary_function<TElement, TElement, bool>
struct SetLess_ : std::function<bool(TElement,TElement)>
{
// key less
inline bool operator() (TElement const &a, TElement const &b) {
Expand Down
23 changes: 12 additions & 11 deletions include/seqan/modifier/modifier_functors.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
#define SEQAN_MODIFIER_MODIFIER_FUNCTORS_H_

#include <cctype>
#include <functional>

// TODO(holtgrew): Make the structs here into classes.

Expand Down Expand Up @@ -76,7 +77,7 @@ namespace seqan
*/

template <typename InType, typename Result = InType>
struct FunctorUpcase : public std::unary_function<InType, Result>
struct FunctorUpcase : std::function<Result(InType)>
{
inline Result operator()(InType x) const
{
Expand Down Expand Up @@ -110,7 +111,7 @@ struct FunctorUpcase : public std::unary_function<InType, Result>
*/

template <typename InType, typename Result = InType>
struct FunctorLowcase : public std::unary_function<InType, Result>
struct FunctorLowcase : std::function<Result(InType)>
{
inline Result operator()(InType x) const
{
Expand Down Expand Up @@ -144,7 +145,7 @@ struct FunctorLowcase : public std::unary_function<InType, Result>
*/

template <typename InType, typename OutType>
struct FunctorConvert : public std::unary_function<InType,OutType>
struct FunctorConvert : std::function<OutType(InType)>
{
inline OutType operator()(InType x) const
{
Expand Down Expand Up @@ -216,7 +217,7 @@ signed char const TranslateTableIupacToIupacComplement_<T>::VALUE[16] = {0, 8, 4
*/

template <>
struct FunctorComplement<char> : public std::unary_function<Dna5,Dna5>
struct FunctorComplement<char> : std::function<Dna5(Dna5)>
{
inline Dna5 operator()(Dna5 x) const
{
Expand All @@ -225,7 +226,7 @@ struct FunctorComplement<char> : public std::unary_function<Dna5,Dna5>
};

template <>
struct FunctorComplement<Dna> : public std::unary_function<Dna,Dna>
struct FunctorComplement<Dna> : std::function<Dna(Dna)>
{
inline Dna operator()(Dna x) const
{
Expand All @@ -234,7 +235,7 @@ struct FunctorComplement<Dna> : public std::unary_function<Dna,Dna>
};

template <>
struct FunctorComplement<Dna5> : public std::unary_function<Dna5,Dna5>
struct FunctorComplement<Dna5> : std::function<Dna5(Dna5)>
{
inline Dna5 operator()(Dna5 x) const
{
Expand All @@ -243,7 +244,7 @@ struct FunctorComplement<Dna5> : public std::unary_function<Dna5,Dna5>
};

template <>
struct FunctorComplement<Rna> : public std::unary_function<Rna,Rna>
struct FunctorComplement<Rna> : std::function<Rna(Rna)>
{
inline Rna operator()(Rna x) const
{
Expand All @@ -252,7 +253,7 @@ struct FunctorComplement<Rna> : public std::unary_function<Rna,Rna>
};

template <>
struct FunctorComplement<Rna5> : public std::unary_function<Rna5,Rna5>
struct FunctorComplement<Rna5> : std::function<Rna5(Rna5)>
{
inline Dna5 operator()(Rna5 x) const
{
Expand All @@ -261,7 +262,7 @@ struct FunctorComplement<Rna5> : public std::unary_function<Rna5,Rna5>
};

template <>
struct FunctorComplement<DnaQ> : public std::unary_function<DnaQ,DnaQ>
struct FunctorComplement<DnaQ> : std::function<DnaQ(DnaQ)>
{
inline DnaQ operator()(DnaQ x) const
{
Expand All @@ -273,7 +274,7 @@ struct FunctorComplement<DnaQ> : public std::unary_function<DnaQ,DnaQ>
};

template <>
struct FunctorComplement<Dna5Q> : public std::unary_function<Dna5Q,Dna5Q>
struct FunctorComplement<Dna5Q> : std::function<Dna5Q(Dna5Q)>
{
inline Dna5Q operator()(Dna5Q x) const {
int qual = getQualityValue(x);
Expand All @@ -284,7 +285,7 @@ struct FunctorComplement<Dna5Q> : public std::unary_function<Dna5Q,Dna5Q>
};

template <>
struct FunctorComplement<Iupac> : public std::unary_function<Iupac,Iupac>
struct FunctorComplement<Iupac> : std::function<Iupac(Iupac)>
{
inline Iupac operator()(Iupac x) const
{
Expand Down
4 changes: 3 additions & 1 deletion include/seqan/modifier/modifier_position.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@
#ifndef SEQAN_MODIFIER_MODIFIER_POSITION_H_
#define SEQAN_MODIFIER_MODIFIER_POSITION_H_

#include <functional>

namespace seqan {

// ============================================================================
Expand Down Expand Up @@ -390,7 +392,7 @@ inline void setPosition(ModifiedString<THost, ModPos<TPositions> > const & me, T
// ----------------------------------------------------------------------------

template <typename THost, typename TPos = typename Position<THost>::Type, typename TPredicate = std::less<TPos> >
struct PosLess_ : public std::binary_function<TPos, TPos, bool>
struct PosLess_ : std::function<bool(TPos, TPos)>
{
THost const & _host;
TPredicate pred;
Expand Down
8 changes: 5 additions & 3 deletions include/seqan/pipe/pipe_filter.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,14 +35,16 @@
#ifndef SEQAN_HEADER_PIPE_FILTER_H
#define SEQAN_HEADER_PIPE_FILTER_H

#include <functional>

namespace seqan
{

//namespace SEQAN_NAMESPACE_PIPELINING
//{

template <typename TValue, typename TResult = typename Value<TValue, 1>::Type>
struct filterI1 : public std::unary_function<TValue, TResult>
struct filterI1 : std::function<TResult(TValue)>
{
inline TResult operator() (const TValue & x) const
{
Expand All @@ -51,7 +53,7 @@ namespace seqan
};

template <typename TValue, typename TResult = typename Value<TValue, 2>::Type>
struct filterI2 : public std::unary_function<TValue, TResult>
struct filterI2 : std::function<TResult(TValue)>
{
inline TResult operator() (const TValue & x) const
{
Expand All @@ -60,7 +62,7 @@ namespace seqan
};

template <typename TValue, typename TResult = typename Value<TValue, 3>::Type>
struct filterI3 : public std::unary_function<TValue, TResult>
struct filterI3 : std::function<TResult(TValue)>
{
inline TResult operator() (const TValue & x) const
{
Expand Down
6 changes: 4 additions & 2 deletions include/seqan/pipe/pool_mapper.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@
#ifndef SEQAN_HEADER_POOL_MAPPER_H
#define SEQAN_HEADER_POOL_MAPPER_H

#include <functional>

namespace seqan
{

Expand Down Expand Up @@ -348,7 +350,7 @@ namespace seqan
cancel();
}

struct insertBucket : public std::unary_function<TPageBucket,void>
struct insertBucket : std::function<void(TPageBucket)>
{
Handler &me;
insertBucket(Handler &_me): me(_me) {}
Expand Down Expand Up @@ -454,7 +456,7 @@ namespace seqan
cancel();
}

struct insertBucket : public std::unary_function<TPageBucket,void>
struct insertBucket : std::function<void(TPageBucket)>
{
Handler &me;
insertBucket(Handler &_me): me(_me) {}
Expand Down
15 changes: 6 additions & 9 deletions include/seqan/pipe/pool_sorter.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,13 +35,13 @@
#ifndef SEQAN_HEADER_POOL_SORTER_H
#define SEQAN_HEADER_POOL_SORTER_H

#include <functional>

namespace seqan
{

template < typename TValue, typename Compare >
struct MergeStreamComparer : public std::binary_function < PageBucket<TValue>,
PageBucket<TValue>,
bool>
struct MergeStreamComparer : std::function<bool(PageBucket<TValue>,PageBucket<TValue>)>
{
Compare C;
MergeStreamComparer(Compare &tmpC): C(tmpC) { }
Expand All @@ -54,10 +54,7 @@ namespace seqan

template < typename TCompare >
struct AdaptorCompare2Less :
public std::binary_function <
typename TCompare::first_argument_type,
typename TCompare::second_argument_type,
bool >
std::function<bool(typename TCompare::first_argument_type,typename TCompare::second_argument_type)>
{
TCompare const & C;
AdaptorCompare2Less(TCompare const & tmpC): C(tmpC) { }
Expand Down Expand Up @@ -203,7 +200,7 @@ namespace seqan
cancel();
}

struct insertBucket : public std::unary_function<TPageBucket,void>
struct insertBucket : std::function<void(TPageBucket)>
{
Handler &me;
insertBucket(Handler &_me): me(_me) {}
Expand Down Expand Up @@ -318,7 +315,7 @@ namespace seqan
cancel();
}

struct insertBucket : public std::unary_function<TPageBucket, void> {
struct insertBucket : std::function<void(TPageBucket)> {
BufferHandler &me;
insertBucket(BufferHandler &_me): me(_me) {}

Expand Down