3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2025-04-06 17:44:08 +00:00

remove '#include <iostream>' from headers and from unneeded places

It's harmful to have iostream everywhere as it injects functions in the compiled files
This commit is contained in:
Nuno Lopes 2022-06-17 14:10:19 +01:00
parent 70bcf0b51d
commit 73a24ca0a9
90 changed files with 99 additions and 95 deletions

View file

@ -1771,7 +1771,6 @@ def write_log_h_preamble(log_h):
def write_log_c_preamble(log_c):
log_c.write('// Automatically generated file\n')
log_c.write('#include<iostream>\n')
log_c.write('#include\"api/z3.h\"\n')
log_c.write('#include\"api/api_log_macros.h\"\n')
log_c.write('#include\"api/z3_logger.h\"\n')

View file

@ -15,7 +15,6 @@ Author:
Revision History:
--*/
#include<iostream>
#include "api/api_log_macros.h"
#include "api/api_context.h"
#include "api/api_util.h"

View file

@ -15,7 +15,6 @@ Author:
Revision History:
--*/
#include<iostream>
#include "api/z3.h"
#include "api/api_log_macros.h"
#include "api/api_context.h"

View file

@ -15,7 +15,6 @@ Author:
Revision History:
--*/
#include<iostream>
#include "api/z3.h"
#include "api/api_log_macros.h"
#include "api/api_context.h"

View file

@ -16,7 +16,6 @@ Author:
Notes:
--*/
#include<iostream>
#include "api/z3.h"
#include "api/api_log_macros.h"
#include "api/api_context.h"

View file

@ -15,7 +15,6 @@ Author:
Revision History:
--*/
#include<iostream>
#include "api/z3.h"
#include "api/api_log_macros.h"
#include "api/api_context.h"

View file

@ -16,7 +16,6 @@ Revision History:
--*/
#include<cmath>
#include<iostream>
#include "api/z3.h"
#include "api/api_log_macros.h"
#include "api/api_context.h"

View file

@ -15,7 +15,6 @@ Author:
Revision History:
--*/
#include<iostream>
#include "util/cancel_eh.h"
#include "util/scoped_timer.h"
#include "util/scoped_ctrl_c.h"

View file

@ -17,7 +17,6 @@ Author:
Revision History:
--*/
#include<iostream>
#include "api/z3.h"
#include "api/api_log_macros.h"
#include "api/api_context.h"

View file

@ -15,7 +15,6 @@ Author:
Revision History:
--*/
#include<iostream>
#include "api/z3.h"
#include "api/api_log_macros.h"
#include "api/api_context.h"

View file

@ -17,7 +17,6 @@ Notes:
--*/
#include <iostream>
#include "ast/expr_map.h"
#include "api/z3.h"
#include "api/api_log_macros.h"

View file

@ -19,7 +19,6 @@ Author:
Notes:
--*/
#include<iostream>
#include "api/z3.h"
#include "api/api_log_macros.h"
#include "api/api_context.h"

View file

@ -16,7 +16,6 @@ Author:
Revision History:
--*/
#include<iostream>
#include<thread>
#include "util/scoped_ctrl_c.h"
#include "util/cancel_eh.h"

View file

@ -17,7 +17,6 @@ Revision History:
--*/
#include <iostream>
#include "api/z3.h"
#include "api/api_log_macros.h"
#include "api/api_context.h"

View file

@ -15,7 +15,6 @@ Author:
Revision History:
--*/
#include<iostream>
#include "api/z3.h"
#include "api/api_log_macros.h"
#include "api/api_context.h"

View file

@ -15,7 +15,6 @@ Author:
Revision History:
--*/
#include<iostream>
#include "api/z3.h"
#include "api/api_log_macros.h"
#include "api/api_context.h"

View file

@ -21,7 +21,7 @@ Notes:
#pragma once
#include<cassert>
#include<iostream>
#include<ostream>
#include<string>
#include<sstream>
#include<memory>

View file

@ -18,7 +18,6 @@ Notes:
--*/
#include<iostream>
#include "util/rational.h"
#include "api/z3_macros.h"

View file

@ -22,6 +22,7 @@ Notes:
#include "util/stream_buffer.h"
#include "util/symbol.h"
#include "util/trace.h"
#include<iostream>
#include<sstream>
#include<vector>

View file

@ -18,7 +18,6 @@ Notes:
--*/
#pragma once
#include<iostream>
#include "api/z3.h"
#include "util/z3_exception.h"

View file

@ -30,6 +30,7 @@ Revision History:
#include "ast/arith_decl_plugin.h"
#include "ast/ast_translation.h"
#include "util/z3_version.h"
#include <iostream>
// -----------------------------------

View file

@ -17,7 +17,7 @@ Revision History:
--*/
#include<iostream>
#include "ast/ast_ll_pp.h"
#include "ast/for_each_ast.h"
#include "ast/arith_decl_plugin.h"
#include "ast/datatype_decl_plugin.h"

View file

@ -19,7 +19,7 @@ Revision History:
#pragma once
#include "ast/ast.h"
#include<iostream>
#include<ostream>
void ast_ll_pp(std::ostream & out, ast_manager & m, ast * n, bool only_exprs=true, bool compact=true);
void ast_ll_pp(std::ostream & out, ast_manager & m, ast * n, ast_mark & visited, bool only_exprs=true, bool compact=true);

View file

@ -6,7 +6,7 @@ Abstract: Pretty-printer for proofs in Graphviz format
#pragma once
#include <iostream>
#include <ostream>
#include "ast/ast_pp.h"
class ast_pp_dot {

View file

@ -18,6 +18,7 @@ Revision History:
--*/
#include "ast/ast_printer.h"
#include "ast/pp.h"
#include <iostream>
class simple_ast_printer_context : public ast_printer_context {
ast_manager & m_manager;
@ -51,3 +52,6 @@ public:
ast_printer_context * mk_simple_ast_printer_context(ast_manager & m) {
return alloc(simple_ast_printer_context, m);
}
std::ostream & ast_printer_context::regular_stream() { return std::cout; }
std::ostream & ast_printer_context::diagnostic_stream() { return std::cerr; }

View file

@ -20,6 +20,7 @@ Revision History:
#include "ast/ast.h"
#include "ast/ast_smt2_pp.h"
#include <ostream>
class ast_printer {
public:
@ -46,8 +47,8 @@ class ast_printer_context : public ast_printer {
public:
~ast_printer_context() override {}
virtual ast_manager & get_ast_manager() = 0;
virtual std::ostream & regular_stream() { return std::cout; }
virtual std::ostream & diagnostic_stream() { return std::cerr; }
virtual std::ostream & regular_stream();
virtual std::ostream & diagnostic_stream();
};

View file

@ -20,7 +20,7 @@ Revision History:
--*/
#include<sstream>
#include<iostream>
#include<ostream>
#include "util/vector.h"
#include "util/smt2_util.h"
#include "ast/ast_smt_pp.h"

View file

@ -162,7 +162,7 @@ expr_ref bv2fpa_converter::convert_bv2rm(expr * bv_rm) {
}
}
else {
std::cout << expr_ref(bv_rm, m) << " not converted\n";
//std::cout << expr_ref(bv_rm, m) << " not converted\n";
}
return res;

View file

@ -124,7 +124,7 @@ void fpa2bv_converter::mk_ite(expr * c, expr * t, expr * f, expr_ref & result) {
result = m_util.mk_bv2rm(result);
}
else {
std::cout << mk_pp(t, m) << " " << mk_pp(f, m) << "\n";
//std::cout << mk_pp(t, m) << " " << mk_pp(f, m) << "\n";
UNREACHABLE();
}

View file

@ -51,6 +51,7 @@ Notes:
#include "solver/smt_logics.h"
#include "cmd_context/basic_cmds.h"
#include "cmd_context/cmd_context.h"
#include <iostream>
func_decls::func_decls(ast_manager & m, func_decl * f):
m_decls(TAG(func_decl*, f, 0)) {

View file

@ -24,6 +24,7 @@ Revision History:
#include <algorithm>
#include <limits>
#include <iomanip>
#include <iostream>
#include <cstring>
#include "util/stopwatch.h"
#include "util/statistics.h"

View file

@ -33,7 +33,7 @@ Revision History:
#include "math/lp/static_matrix.h"
#include <string>
#include "math/lp/numeric_pair.h"
#include <iostream>
#include <ostream>
#include <fstream>
#include "math/lp/row_eta_matrix.h"
#include "math/lp/square_dense_submatrix.h"

View file

@ -26,7 +26,7 @@ Revision History:
#include <string>
#include "util/vector.h"
#include <unordered_map>
#include <iostream>
#include <ostream>
#include <fstream>
#include <locale>
#include "math/lp/lp_primal_simplex.h"

View file

@ -29,6 +29,7 @@ Notes:
#include "util/ref_vector.h"
#include "util/ref_buffer.h"
#include "util/common_msgs.h"
#include <iostream>
#ifndef REALCLOSURE_INI_BUFFER_SIZE
#define REALCLOSURE_INI_BUFFER_SIZE 32

View file

@ -281,7 +281,7 @@ namespace simplex {
vector<_row> const& m_rows;
void move_to_next() {
while (m_curr < m_rows.size() && m_rows[m_curr].size() == 0) {
std::cout << "size is 0 for " << m_curr << "\n";
//std::cout << "size is 0 for " << m_curr << "\n";
++m_curr;
}
}

View file

@ -18,7 +18,7 @@ Revision History:
--*/
#pragma once
#include<iostream>
#include<ostream>
#include "util/tptr.h"
#include "util/small_object_allocator.h"
#include "util/chashtable.h"

View file

@ -26,6 +26,7 @@ Revision History:
#include "util/mpff.h"
#include "util/mpfx.h"
#include "util/f2n.h"
#include <iostream>
class subpaving_tactic : public tactic {

View file

@ -19,7 +19,7 @@ Revision History:
--*/
#pragma once
#include<iostream>
#include<ostream>
class model_core;
void model_pp(std::ostream & out, model_core const & m);

View file

@ -18,6 +18,7 @@ Revision History:
#include "model/model_v2_pp.h"
#include "model/model_core.h"
#include "ast/ast_pp.h"
#include <iostream>
static void display_function(std::ostream & out, model_core const & md, func_decl * f, bool partial) {
ast_manager & m = md.get_manager();

View file

@ -17,7 +17,7 @@ Revision History:
--*/
#pragma once
#include<iostream>
#include<ostream>
class model_core;
void model_v2_pp(std::ostream & out, model_core const & m, bool partial = false);

View file

@ -121,11 +121,11 @@ namespace datalog {
}
void boogie_proof::set_proof(proof* p) {
std::cout << "set proof\n";
//std::cout << "set proof\n";
m_proof = p;
proof_utils::push_instantiations_up(m_proof);
mk_input_resolution(m_proof);
std::cout << "proof set\n";
//std::cout << "proof set\n";
}
void boogie_proof::set_model(model* m) {
@ -201,7 +201,7 @@ namespace datalog {
ptr_vector<proof> todo;
todo.push_back(p);
ast_mark visited;
std::cout << "get_subst\n" << mk_pp(p, m) << "\n";
//std::cout << "get_subst\n" << mk_pp(p, m) << "\n";
while (!todo.empty()) {
proof* p = todo.back();
todo.pop_back();

View file

@ -17,6 +17,7 @@ Revision History:
--*/
#include<iostream>
#include<sstream>
#include<limits>
#include "ast/arith_decl_plugin.h"

View file

@ -257,12 +257,14 @@ namespace datalog {
}
container[i-ofs] = container[i];
}
#if 0
if (r_i != removed_col_cnt) {
for (unsigned i = 0; i < removed_col_cnt; ++i) {
std::cout << removed_cols[i] << " ";
}
std::cout << " container size: " << n << "\n";
}
#endif
SASSERT(r_i==removed_col_cnt);
container.resize(n-removed_col_cnt);
}

View file

@ -26,6 +26,7 @@ Revision History:
#include "ast/scoped_proof.h"
#include "ast/bv_decl_plugin.h"
#include "muz/rel/tbv.h"
#include <iostream>
namespace datalog {
@ -224,9 +225,9 @@ namespace datalog {
}
void display_statistics(std::ostream& out) const {
std::cout << "Number of insertions: " << m_stats.m_num_inserts << "\n";
std::cout << "Number of comparisons: " << m_stats.m_num_comparisons << "\n";
std::cout << "Number of nodes: " << size() << "\n";
out << "Number of insertions: " << m_stats.m_num_inserts << "\n"
"Number of comparisons: " << m_stats.m_num_comparisons << "\n"
"Number of nodes: " << size() << "\n";
}
void display(std::ostream& out) const {

View file

@ -108,13 +108,11 @@ namespace datalog {
rule *r = *II;
unsigned numqs = r->get_positive_tail_size();
if (numqs > 1) {
std::cerr << "non-linear clauses not supported\n";
exit(-1);
throw default_exception("non-linear clauses not supported");
}
if (numqs != r->get_uninterpreted_tail_size()) {
std::cerr << "negation of queries not supported\n";
exit(-1);
throw default_exception("negation of queries not supported");
}
exprs.reset();

View file

@ -18,8 +18,6 @@ Revision History:
--*/
#pragma once
#include<iostream>
#include<list>
#include<utility>
#include "ast/ast.h"

View file

@ -18,7 +18,7 @@ Revision History:
--*/
#pragma once
#include<iostream>
#include<ostream>
#include<string>
#include<utility>
#include "ast/ast.h"

View file

@ -19,7 +19,6 @@ Revision History:
#pragma once
#include<iostream>
#include<list>
#include<utility>

View file

@ -18,7 +18,6 @@ Revision History:
--*/
#pragma once
#include<iostream>
#include<list>
#include<utility>

View file

@ -19,7 +19,7 @@ Notes:
#pragma once
#include<iostream>
#include<ostream>
#include<map>
#include "util/ref.h"
#include "util/ref_vector.h"

View file

@ -39,6 +39,7 @@ namespace datalog {
}
rule_set * mk_array_instantiation::operator()(rule_set const & source) {
#if 0
std::cout<<"Array Instantiation called with parameters :"
<<" enforce="<<m_ctx.get_params().xform_instantiate_arrays_enforce()
<<" nb_quantifier="<<m_ctx.get_params().xform_instantiate_arrays_nb_quantifier()
@ -46,6 +47,7 @@ namespace datalog {
<<"\n";
std::cout<<"Input rules = \n";
source.display(std::cout);
#endif
src_set = &source;
scoped_ptr<rule_set> result = alloc(rule_set, m_ctx);
dst = result.get();
@ -55,8 +57,10 @@ namespace datalog {
rule & r = *source.get_rule(i);
instantiate_rule(r, *result);
}
#if 0
std::cout<<"\n\nOutput rules = \n";
result->display(std::cout);
#endif
return result.detach();
}

View file

@ -18,7 +18,7 @@ Revision History:
--*/
#include "opt/opt_context.h"
#include "opt/opt_parse.h"
#include <iostream>
class opt_stream_buffer {
std::istream & m_stream;

View file

@ -12,7 +12,7 @@ Abstract:
#pragma once
#include <string>
#include <iostream>
#include <ostream>
#include "ast/ast.h"

View file

@ -18,7 +18,7 @@ Revision History:
--*/
#pragma once
#include<iostream>
#include<istream>
#include "util/symbol.h"
#include "util/vector.h"
#include "util/rational.h"

View file

@ -26,7 +26,6 @@ class cost_parser : public simple_parser {
var_ref_vector m_vars;
public:
cost_parser(ast_manager & m);
~cost_parser() override {}
expr * parse_int(rational const & r) override;
expr * parse_float(rational const & r) override;
unsigned add_var(symbol name);

View file

@ -17,6 +17,7 @@ Revision History:
--*/
#include "parsers/util/scanner.h"
#include <iostream>
inline int scanner::read_char() {
if (m_is_interactive) {

View file

@ -17,6 +17,7 @@ Revision History:
--*/
#include<fstream>
#include<iostream>
#include<sstream>
#include "parsers/util/simple_parser.h"
#include "util/warning.h"

View file

@ -818,11 +818,12 @@ namespace sat {
lbool r = s.check();
IF_VERBOSE(10, verbose_stream() << "check: " << r << "\n");
if (r == l_true) {
std::sort(vars.begin(), vars.end());
s.display(std::cout);
for (auto v : vars) std::cout << v << " := " << s.get_model()[v] << "\n";
std::string line;
std::getline(std::cin, line);
IF_VERBOSE(0,
std::sort(vars.begin(), vars.end());
s.display(verbose_stream());
for (auto v : vars) verbose_stream() << v << " := " << s.get_model()[v] << "\n";
);
UNREACHABLE();
}
}
};

View file

@ -75,8 +75,7 @@ namespace sat {
IF_VERBOSE(0,
verbose_stream() << "not validated: " << clause << "\n";
s.display(verbose_stream()););
std::string line;
std::getline(std::cin, line);
UNREACHABLE();
}
}
};

View file

@ -467,9 +467,7 @@ namespace sat {
literal_vector lits(n, c);
IF_VERBOSE(0, verbose_stream() << "Verification of " << lits << " failed\n");
// s.display(std::cout);
std::string line;
std::getline(std::cin, line);
exit(0);
UNREACHABLE();
#if 0
SASSERT(false);
INVOKE_DEBUGGER();

View file

@ -1831,8 +1831,8 @@ namespace sat {
if (not_l == l2)
continue;
if ((~l2).index() >= m_visited.size()) {
s.display(std::cout << l2 << " " << s.num_vars() << " " << m_visited.size() << "\n");
exit(0);
//s.display(std::cout << l2 << " " << s.num_vars() << " " << m_visited.size() << "\n");
UNREACHABLE();
}
if (m_visited[(~l2).index()]) {
res = false;

View file

@ -93,8 +93,10 @@ namespace array {
validate_extensionality(n, k);
}
expr* x = nullptr, *y = nullptr;
#if 0
if (m.is_eq(n->get_expr(), x, y) && a.is_array(x))
std::cout << ctx.bpp(n) << " " << s().value(n->bool_var()) << "\n";
#endif
if (m.is_eq(n->get_expr(), x, y) && a.is_array(x) && s().value(n->bool_var()) == l_false)
validate_extensionality(expr2enode(x), expr2enode(y));
}

View file

@ -93,6 +93,7 @@ namespace bv {
} while (curr != v);
zero_one_bits const& _bits = m_zero_one_bits[v];
#if 0
if (_bits.size() != num_bits) {
std::cout << "v" << v << " " << _bits.size() << " " << num_bits << "\n";
std::cout << "true: " << mk_true() << "\n";
@ -102,6 +103,7 @@ namespace bv {
}
while (curr != v);
}
#endif
SASSERT(_bits.size() == num_bits);
VERIFY(_bits.size() == num_bits);
bool_vector already_found;

View file

@ -1624,7 +1624,7 @@ namespace pb {
CTRACE("ba", coeff == 0, display(tout << l << " coeff: " << coeff << "\n", p, true););
if (_debug_conflict) {
std::cout << "coeff " << coeff << "\n";
IF_VERBOSE(0, verbose_stream() << "coeff " << coeff << "\n";);
}
SASSERT(coeff > 0);
@ -2256,7 +2256,7 @@ namespace pb {
SASSERT(c.lit() == sat::null_literal || c.is_watched(*this, c.lit()));
// pre-condition is that the literals, except c.lit(), in c are unwatched.
if (c.id() == _bad_id) std::cout << "recompile: " << c << "\n";
//if (c.id() == _bad_id) std::cout << "recompile: " << c << "\n";
m_weights.resize(2*s().num_vars(), 0);
for (literal l : c) {
++m_weights[l.index()];

View file

@ -302,9 +302,10 @@ namespace q {
return md->v2t[md->values[j]];
};
#if 0
for (unsigned j = 0; j < sz; ++j)
std::cout << mk_pp(md->values[j], m) << "\n";
#endif
expr* arg = t->get_arg(i);

View file

@ -15,6 +15,7 @@ Author:
#include "util/rlimit.h"
#include "util/gparams.h"
#include "util/mutex.h"
#include <iostream>
#include <signal.h>
#include "smt/params/smt_params_helper.hpp"

View file

@ -4,6 +4,7 @@ Copyright (c) 2015 Microsoft Corporation
--*/
#include<fstream>
#include<iostream>
#include<signal.h>
#include<time.h>
#include "util/gparams.h"

View file

@ -42,6 +42,7 @@ Revision History:
#include "smt/smt_model_finder.h"
#include "smt/smt_parallel.h"
#include "smt/smt_arith_value.h"
#include <iostream>
namespace smt {
@ -3943,8 +3944,7 @@ namespace smt {
if (m_fparams.m_model_on_final_check) {
mk_proto_model();
model_pp(std::cout, *m_proto_model);
std::cout << "END_OF_MODEL\n";
std::cout.flush();
std::cout << "END_OF_MODEL" << std::endl;
}
m_stats.m_num_final_checks++;

View file

@ -136,9 +136,9 @@ namespace smt {
}
void context::display_profile_res_sub(std::ostream & out) const {
display_var_occs_histogram(std::cerr);
display_num_min_occs(std::cerr);
std::cerr << "\n";
display_var_occs_histogram(out);
display_num_min_occs(out);
out << "\n";
}
void context::display_profile(std::ostream & out) const {

View file

@ -18,8 +18,6 @@ Revision History:
--*/
#pragma once
#include<iostream>
namespace smt {
struct statistics {

View file

@ -272,12 +272,14 @@ namespace smt {
std::cout << smt << "\n";
std::cout << tns << "\n";
#endif
#if 0
if (tns == sz1) {
std::cout << "SEEN " << tms << "\n";
}
if (tns == sz2) {
std::cout << "SEEN " << smt << "\n";
}
#endif
ctx().push_trail(value_trail<bool>(i1.m_is_leaf, false));
ctx().push_trail(value_trail<bool>(i2.m_is_leaf, false));
expr_ref k1(m), k2(m), k3(m);

View file

@ -1598,10 +1598,12 @@ namespace smt {
lbool is_sat = k.check();
validating = false;
// std::cout << is_sat << "\n";
#if 0
if (is_sat == l_true) {
std::cout << A << "\n";
std::cout << B << "\n";
}
#endif
SASSERT(is_sat != l_true);
return true;
}

View file

@ -368,7 +368,6 @@ br_status bv2real_rewriter::mk_app_core(func_decl * f, unsigned num_args, expr *
tout << "\n";);
if (u().memory_exceeded()) {
std::cout << "tactic exception\n";
throw tactic_exception("bv2real-memory exceeded");
}
if(f->get_family_id() == m_arith.get_family_id()) {

View file

@ -29,6 +29,7 @@ Notes:
#include "ast/fpa_decl_plugin.h"
#include "tactic/tactical.h"
#include "util/stats.h"
#include <iostream>
#include "tactic/core/collect_statistics_tactic.h"

View file

@ -19,7 +19,7 @@ Notes:
--*/
#pragma once
#include<iostream>
#include<ostream>
#include<climits>
class approx_nat {

View file

@ -17,7 +17,7 @@ Revision History:
--*/
#pragma once
#include<iostream>
#include<ostream>
#include "util/debug.h"
template<typename T> class approx_set_traits;

View file

@ -14,7 +14,6 @@ Author:
Notes:
--*/
#include<iostream>
#include "util/cmd_context_types.h"
std::ostream & operator<<(std::ostream & out, cmd_arg_kind k) {

View file

@ -18,6 +18,7 @@ Notes:
#include "util/symbol.h"
#include "util/z3_exception.h"
#include <ostream>
#include<sstream>
class rational;
class expr;

View file

@ -19,7 +19,7 @@ Revision History:
--*/
#pragma once
#include<iostream>
#include<ostream>
#include "util/debug.h"
enum ext_numeral_kind { EN_MINUS_INFINITY, EN_NUMERAL, EN_PLUS_INFINITY };

View file

@ -18,7 +18,7 @@ Revision History:
--*/
#pragma once
#include<iostream>
#include<ostream>
#include "util/vector.h"
class permutation {

View file

@ -18,7 +18,7 @@ Revision History:
--*/
#pragma once
#include<cstdlib>
#include<iostream>
#include<ostream>
#ifdef Z3DEBUG

View file

@ -17,7 +17,6 @@ Revision History:
--*/
#include<signal.h>
#include<iostream>
#include "util/scoped_ctrl_c.h"
static scoped_ctrl_c * g_obj = nullptr;

View file

@ -18,7 +18,7 @@ Notes:
--*/
#pragma once
#include<iostream>
#include<ostream>
#include "util/vector.h"
#include "util/rlimit.h"

View file

@ -21,7 +21,7 @@ Revision History:
#include "util/debug.h"
#include <chrono>
#include <iostream>
#include <ostream>
#include<iomanip>

View file

@ -20,7 +20,7 @@ Revision History:
--*/
#pragma once
#include<iostream>
#include<istream>
class stream_buffer {
std::istream & m_stream;
@ -40,5 +40,3 @@ public:
m_val = m_stream.get();
}
};

View file

@ -16,11 +16,11 @@ Author:
Revision History:
--*/
#include<iostream>
#include "util/timeit.h"
#include "util/memory_manager.h"
#include "util/stopwatch.h"
#include<iomanip>
#include<iostream>
struct timeit::imp {
stopwatch m_watch;
@ -45,9 +45,9 @@ struct timeit::imp {
}
};
timeit::timeit(bool enable, char const * msg, std::ostream & out) {
timeit::timeit(bool enable, char const * msg, std::ostream * out) {
if (enable)
m_imp = alloc(imp, msg, out);
m_imp = alloc(imp, msg, out ? *out : std::cerr);
else
m_imp = nullptr;
}

View file

@ -21,11 +21,14 @@ Revision History:
--*/
#pragma once
#include<ostream>
class timeit {
struct imp;
imp * m_imp;
public:
timeit(bool enable, char const * msg, std::ostream & out = std::cerr);
timeit(bool enable, char const * msg, std::ostream * out = nullptr);
timeit(bool enable, char const * msg, std::ostream & out) : timeit(enable, msg, &out) {}
~timeit();
};

View file

@ -18,7 +18,7 @@ Revision History:
--*/
#include "util/util.h"
#include <iostream>
static unsigned g_verbosity_level = 0;

View file

@ -20,7 +20,7 @@ Revision History:
#include "util/debug.h"
#include "util/memory_manager.h"
#include<iostream>
#include<ostream>
#include<climits>
#include<limits>
#include<stdint.h>

View file

@ -17,7 +17,7 @@ Revision History:
--*/
#pragma once
#include<iostream>
#include<ostream>
#include<stdarg.h>
void send_warnings_to_stdout(bool flag);