Skip to content

Commit

Permalink
move absl::Stringify(int128) from cuts.cc to base/logging.h
Browse files Browse the repository at this point in the history
  • Loading branch information
lperron committed Aug 10, 2023
1 parent 797b0ea commit aaf306c
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 10 deletions.
1 change: 1 addition & 0 deletions ortools/base/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ cc_library(
"@com_google_absl//absl/flags:usage",
"@com_google_absl//absl/log:die_if_null",
"@com_google_absl//absl/log:initialize",
"@com_google_absl//absl/numeric:int128",
"@com_google_absl//absl/strings",
"@com_google_absl//absl/synchronization",
],
Expand Down
10 changes: 10 additions & 0 deletions ortools/base/logging.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
#include "absl/log/die_if_null.h"
#include "absl/log/log.h"
#include "absl/memory/memory.h"
#include "absl/numeric/int128.h"
#include "absl/status/status.h"
#include "absl/strings/str_cat.h"
#include "absl/strings/string_view.h"
Expand Down Expand Up @@ -52,4 +53,13 @@ enum LogSeverity {
};
} // namespace google

namespace absl {
template <typename Sink>
void AbslStringify(Sink& sink, absl::int128 v) {
std::ostringstream oss;
oss << v;
sink.Append(oss.str());
}
} // namespace absl

#endif // OR_TOOLS_BASE_LOGGING_H_
10 changes: 0 additions & 10 deletions ortools/sat/cuts.cc
Original file line number Diff line number Diff line change
Expand Up @@ -46,16 +46,6 @@
#include "ortools/util/sorted_interval_list.h"
#include "ortools/util/strong_integers.h"

// TODO(user): move to or-tools/base/logging.h
namespace absl {
template <typename Sink>
void AbslStringify(Sink& sink, absl::int128 v) {
std::ostringstream oss;
oss << v;
sink.Append(oss.str());
}
} // namespace absl

namespace operations_research {
namespace sat {

Expand Down

0 comments on commit aaf306c

Please sign in to comment.