Skip to content

Commit

Permalink
chore: remove compiler warning unary_function deprecated
Browse files Browse the repository at this point in the history
  • Loading branch information
caballa committed Sep 21, 2023
1 parent 3b24233 commit 8e6fb0b
Show file tree
Hide file tree
Showing 8 changed files with 16 additions and 36 deletions.
12 changes: 3 additions & 9 deletions include/crab/analysis/dataflow/assertion_crawler.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -170,9 +170,7 @@ class assertion_crawler_domain {

// Helper that applies a function to each pair of discrete_pair_domain.
template<typename Key, typename Value>
struct transform_discrete_pair_domain
: public std::unary_function<discrete_pair_domain<Key,Value>,
discrete_pair_domain<Key,Value>> {
struct transform_discrete_pair_domain {
using discrete_pair_domain_t = discrete_pair_domain<Key, Value>;

template<typename Op>
Expand Down Expand Up @@ -332,9 +330,7 @@ class assertion_crawler_operations
using variable_t = typename CFG::variable_t;

/** Add data-dependencies **/
class add_data_deps:
public std::unary_function<var_dom_t, std::pair<var_dom_t, bool>> {

class add_data_deps {
var_dom_t m_uses;
var_dom_t m_defs;
public:
Expand Down Expand Up @@ -432,9 +428,7 @@ class assertion_crawler_operations
};

/** Remove data-dependencies **/
class remove_deps
: public std::unary_function<var_dom_t, std::pair<var_dom_t, bool>> {

class remove_deps {
var_dom_t vars;
public:
remove_deps(const variable_t &v) : vars(var_dom_t::bottom()) {
Expand Down
6 changes: 2 additions & 4 deletions include/crab/analysis/graphs/sccg.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -86,8 +86,7 @@ template <typename G> class scc_graph {
using edge_t = Edge<node_t>;

private:
struct MkNode : public std::unary_function<vertex_descriptor_t, node_t> {

struct MkNode {
scc_graph_t *_g;

MkNode() : _g(nullptr) {}
Expand All @@ -97,8 +96,7 @@ template <typename G> class scc_graph {
}
};

struct MkEdge : public std::unary_function<edge_descriptor_t, Edge<node_t>> {

struct MkEdge {
scc_graph_t *_g;

MkEdge() : _g(nullptr) {}
Expand Down
7 changes: 3 additions & 4 deletions include/crab/cfg/cfg.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -3294,12 +3294,12 @@ class cfg {
using binding_t = typename basic_block_map_t::value_type;
using live_domain_t = typename basic_block_t::live_domain_t;

struct get_ref : public std::unary_function<binding_t, basic_block_t> {
struct get_ref {
get_ref() {}
basic_block_t &operator()(const binding_t &p) const { return *(p.second); }
};

struct get_label : public std::unary_function<binding_t, BasicBlockLabel> {
struct get_label {
get_label() {}
BasicBlockLabel operator()(const binding_t &p) const {
return p.second->label();
Expand Down Expand Up @@ -3956,8 +3956,7 @@ class cfg_rev {
using cfg_rev_t = cfg_rev<CFGRef>;

private:
struct getRev : public std::unary_function<typename CFGRef::basic_block_t,
basic_block_t> {
struct getRev {
const std::unordered_map<basic_block_label_t, basic_block_t> &_rev_bbs;

getRev(
Expand Down
8 changes: 2 additions & 6 deletions include/crab/cfg/cfg_bgl.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,7 @@ namespace crab {
namespace cfg {
namespace graph {
template <typename G>
struct mk_in_edge : public std::unary_function<
typename boost::graph_traits<G>::vertex_descriptor,
typename boost::graph_traits<G>::edge_descriptor> {
struct mk_in_edge {
using Node = typename boost::graph_traits<G>::vertex_descriptor;
using Edge = typename boost::graph_traits<G>::edge_descriptor;

Expand All @@ -26,9 +24,7 @@ struct mk_in_edge : public std::unary_function<
};

template <typename G>
struct mk_out_edge : public std::unary_function<
typename boost::graph_traits<G>::vertex_descriptor,
typename boost::graph_traits<G>::edge_descriptor> {
struct mk_out_edge {
using Node = typename boost::graph_traits<G>::vertex_descriptor;
using Edge = typename boost::graph_traits<G>::edge_descriptor;

Expand Down
6 changes: 2 additions & 4 deletions include/crab/cg/cg.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -173,8 +173,7 @@ template <typename CFG> class call_graph {
}
};

struct mk_node
: public std::unary_function<vertex_descriptor_t, cg_node<CFG>> {
struct mk_node {
cg_t *_cg;
mk_node() : _cg(nullptr) {}
mk_node(cg_t *cg) : _cg(cg) {}
Expand All @@ -184,8 +183,7 @@ template <typename CFG> class call_graph {
}
};

struct mk_edge
: public std::unary_function<edge_descriptor_t, cg_edge<cg_node<CFG>>> {
struct mk_edge {
cg_t *_cg;
mk_edge() : _cg(nullptr) {}
mk_edge(cg_t *cg) : _cg(cg) {}
Expand Down
4 changes: 1 addition & 3 deletions include/crab/domains/herbrand_domain.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -85,9 +85,7 @@ class herbrand_domain final

using var_map_t = boost::container::flat_map<variable_t, term_id_t>;

struct get_term_transform :
public std::unary_function<typename var_map_t::value_type,
std::pair<variable_t, const term_t*>> {
struct get_term_transform {
const ttbl_t &m_ttbl;
get_term_transform(const ttbl_t& ttbl): m_ttbl(ttbl) {}
std::pair<variable_t, const term_t*>
Expand Down
3 changes: 1 addition & 2 deletions include/crab/domains/union_find_domain.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -366,8 +366,7 @@ class union_find_domain {
}
}

struct get_absval_from_ec:
public std::unary_function<typename classes_map_t::value_type, Domain> {
struct get_absval_from_ec {

std::shared_ptr<const Domain> operator()(const typename classes_map_t::value_type &kv) const {
return kv.second.get_absval();
Expand Down
6 changes: 2 additions & 4 deletions include/crab/types/linear_constraints.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -100,16 +100,14 @@ template <typename Number, typename VariableName> class linear_expression {
}
}

struct tr_value_ty
: public std::unary_function<typename map_t::value_type, component_t> {
struct tr_value_ty {
tr_value_ty() {}
component_t operator()(const typename map_t::value_type &kv) const {
return {kv.second, kv.first};
}
};

struct get_var
: public std::unary_function<typename map_t::value_type, variable_t> {
struct get_var {
get_var() {}
variable_t operator()(const typename map_t::value_type &kv) const {
return kv.first;
Expand Down

0 comments on commit 8e6fb0b

Please sign in to comment.