remove uses of unary_function and binary_function

These were deprecated in C++11, and are supposed to be removed from
C++17, however gcc-snapshot just started warning about those.

* spot/misc/bddlt.hh, spot/misc/hash.hh, spot/misc/ltstr.hh,
spot/twa/taatgba.hh, spot/twaalgos/ltl2tgba_fm.cc: Here.
This commit is contained in:
Alexandre Duret-Lutz 2022-02-07 16:10:40 +01:00
parent a3753e608b
commit 58f33deeca
5 changed files with 15 additions and 24 deletions

View file

@ -1,5 +1,5 @@
// -*- coding: utf-8 -*-
// Copyright (C) 2011, 2014, 2017, 2021 Laboratoire de Recherche et
// Copyright (C) 2011, 2014, 2017, 2021, 2022 Laboratoire de Recherche et
// Developpement de l'Epita (LRDE).
// Copyright (C) 2003, 2004 Laboratoire d'Informatique de Paris 6 (LIP6),
// département Systèmes Répartis Coopératifs (SRC), Université Pierre
@ -33,8 +33,7 @@ namespace spot
/// This comparison function use BDD ids for efficiency. An
/// algorithm depending on this order may return different results
/// depending on how the BDD library has been used before.
struct bdd_less_than :
public std::binary_function<const bdd&, const bdd&, bool>
struct bdd_less_than
{
bool
operator()(const bdd& left, const bdd& right) const
@ -50,8 +49,7 @@ namespace spot
/// long as the variable order is the same, the output of this
/// comparison will be stable and independent on previous BDD
/// operations.
struct bdd_less_than_stable :
public std::binary_function<const bdd&, const bdd&, bool>
struct bdd_less_than_stable
{
bool
operator()(const bdd& left, const bdd& right) const
@ -62,8 +60,7 @@ namespace spot
/// \ingroup misc_tools
/// \brief Hash functor for BDDs.
struct bdd_hash :
public std::unary_function<const bdd&, size_t>
struct bdd_hash
{
size_t
operator()(const bdd& b) const noexcept

View file

@ -1,5 +1,5 @@
// -*- coding: utf-8 -*-
// Copyright (C) 2008, 2011, 2014, 2015-2018, 2021 Laboratoire de
// Copyright (C) 2008, 2011, 2014, 2015-2018, 2021, 2022 Laboratoire de
// Recherche et Développement de l'Epita (LRDE).
// Copyright (C) 2003, 2004, 2005 Laboratoire d'Informatique de
// Paris 6 (LIP6), département Systèmes Répartis Coopératifs (SRC),
@ -36,8 +36,7 @@ namespace spot
/// \ingroup hash_funcs
/// \brief A hash function for pointers.
template <class T>
struct ptr_hash :
public std::unary_function<const T*, size_t>
struct ptr_hash
{
// A default constructor is needed if the ptr_hash object is
// stored in a const member. This occur with the clang version
@ -59,8 +58,7 @@ namespace spot
/// \ingroup hash_funcs
/// \brief A hash function that returns identity
template<typename T>
struct identity_hash:
public std::unary_function<const T&, size_t>
struct identity_hash
{
// A default constructor is needed if the identity_hash object is
// stored in a const member.

View file

@ -1,5 +1,5 @@
// -*- coding: utf-8 -*-
// Copyright (C) 2015 Laboratoire de Recherche et Développement
// Copyright (C) 2015, 2022 Laboratoire de Recherche et Développement
// de l'Epita (LRDE)
// Copyright (C) 2005 Laboratoire d'Informatique de Paris 6 (LIP6),
// département Systèmes Répartis Coopératifs (SRC), Université Pierre
@ -39,8 +39,7 @@ namespace spot
/// \code
/// std::map<const char*, int, spot::state_ptr_less_than> seen;
/// \endcode
struct char_ptr_less_than:
public std::binary_function<const char*, const char*, bool>
struct char_ptr_less_than
{
bool
operator()(const char* left, const char* right) const

View file

@ -1,6 +1,6 @@
// -*- coding: utf-8 -*-
// Copyright (C) 2009, 2011-2019 Laboratoire de Recherche et Développement de
// l'Epita (LRDE).
// Copyright (C) 2009, 2011-2019, 2022 Laboratoire de Recherche et
// Développement de l'Epita (LRDE).
//
// This file is part of Spot, a model checking library.
//
@ -121,9 +121,7 @@ namespace spot
std::vector<taa_tgba::transition*>,
state_ptr_hash, state_ptr_equal> seen_map;
struct distance_sort :
public std::binary_function<const iterator_pair&,
const iterator_pair&, bool>
struct distance_sort
{
bool
operator()(const iterator_pair& lhs, const iterator_pair& rhs) const

View file

@ -1,6 +1,6 @@
// -*- coding: utf-8 -*-
// Copyright (C) 2008-2019, 2021 Laboratoire de Recherche et Développement
// de l'Epita (LRDE).
// Copyright (C) 2008-2019, 2021-2022 Laboratoire de Recherche et
// Développement de l'Epita (LRDE).
// Copyright (C) 2003-2006 Laboratoire d'Informatique de Paris 6
// (LIP6), département Systèmes Répartis Coopératifs (SRC), Université
// Pierre et Marie Curie.
@ -199,8 +199,7 @@ namespace spot
}
};
struct flagged_formula_hash:
public std::unary_function<flagged_formula, size_t>
struct flagged_formula_hash
{
size_t
operator()(const flagged_formula& that) const