@@ -25,43 +25,6 @@ unwrap_and_extract_values(const abstract_object_sett &values);
2525static abstract_object_pointert
2626maybe_extract_single_value (const abstract_object_pointert &maybe_singleton);
2727
28- // / Recursively construct a combination \p sub_con from \p super_con and once
29- // / constructed call \p f.
30- // / \param super_con: vector of some containers storing the values
31- // / \param sub_con: the one combination being currently constructed
32- // / \param f: callable with side-effects
33- template <typename Con, typename F>
34- void apply_comb (
35- const std::vector<Con> &super_con,
36- std::vector<typename Con::value_type> &sub_con,
37- F f)
38- {
39- size_t n = sub_con.size ();
40- if (n == super_con.size ())
41- f (sub_con);
42- else
43- {
44- for (const auto &value : super_con[n])
45- {
46- sub_con.push_back (value);
47- apply_comb (super_con, sub_con, f);
48- sub_con.pop_back ();
49- }
50- }
51- }
52-
53- // / Call the function \p f on every combination of elements in \p super_con.
54- // / Hence the arity of \p f is `super_con.size()`. <{1,2},{1},{1,2,3}> ->
55- // / f(1,1,1), f(1,1,2), f(1,1,3), f(2,1,1), f(2,1,2), f(2,1,3).
56- // / \param super_con: vector of some containers storing the values
57- // / \param f: callable with side-effects
58- template <typename Con, typename F>
59- void for_each_comb (const std::vector<Con> &super_con, F f)
60- {
61- std::vector<typename Con::value_type> sub_con;
62- apply_comb (super_con, sub_con, f);
63- }
64-
6528value_set_pointer_abstract_objectt::value_set_pointer_abstract_objectt (
6629 const typet &type)
6730 : abstract_pointer_objectt(type)
0 commit comments