diff --git a/examples/cpp/model_util.cc b/examples/cpp/model_util.cc index 6d324cf366..ccbb6fa596 100644 --- a/examples/cpp/model_util.cc +++ b/examples/cpp/model_util.cc @@ -11,6 +11,8 @@ // See the License for the specific language governing permissions and // limitations under the License. +#include "base/unique_ptr.h" + #include "base/commandlineflags.h" #include "base/commandlineflags.h" #include "base/integral_types.h" @@ -203,7 +205,7 @@ void DeclareConstraint(int index, void ExportToGraphFile(const CPModelProto& proto, File* const file, GraphExporter::GraphFormat format) { - scoped_ptr exporter( + std::unique_ptr exporter( GraphExporter::MakeFileExporter(file, format)); exporter->WriteHeader(proto.model()); for (int i = 0; i < proto.expressions_size(); ++i) { @@ -274,7 +276,6 @@ void ExportToGraphFile(const CPModelProto& proto, int Run() { // ----- Load input file into protobuf ----- - File::Init(); File* const file = File::Open(FLAGS_input, "r"); if (file == NULL) { LOG(WARNING) << "Cannot open " << FLAGS_input; diff --git a/examples/cpp/nqueens.cc b/examples/cpp/nqueens.cc index 44c5ff8a7b..a7a2c828ef 100644 --- a/examples/cpp/nqueens.cc +++ b/examples/cpp/nqueens.cc @@ -77,7 +77,7 @@ class NQueenSymmetry : public SymmetryBreaker { private: Solver* const solver_; const std::vector vars_; - std::map indices_; + std::map indices_; const int size_; }; diff --git a/examples/cpp/parse_dimacs_assignment.h b/examples/cpp/parse_dimacs_assignment.h index 79386b2975..f4b8cbf46b 100644 --- a/examples/cpp/parse_dimacs_assignment.h +++ b/examples/cpp/parse_dimacs_assignment.h @@ -21,6 +21,7 @@ #include #include #include +#include "base/unique_ptr.h" #include #include "base/callback.h" @@ -89,7 +90,7 @@ template class DimacsAssignmentParser { const char* reason; NodeIndex num_left_nodes; ArcIndex num_arcs; - scoped_ptr bad_line; + std::unique_ptr bad_line; }; ErrorTrackingState state_; @@ -288,7 +289,7 @@ LinearSumAssignment* DimacsAssignmentParser::Parse( *error_message = "empty graph description"; return NULL; } - scoped_ptr > cycle_handler( + std::unique_ptr > cycle_handler( assignment_->ArcAnnotationCycleHandler()); GraphType* graph = graph_builder_->Graph(cycle_handler.get()); if (graph == NULL) { diff --git a/examples/cpp/strawberry_fields_with_column_generation.cc b/examples/cpp/strawberry_fields_with_column_generation.cc index 4e2bf58fa2..74f30fbb9d 100644 --- a/examples/cpp/strawberry_fields_with_column_generation.cc +++ b/examples/cpp/strawberry_fields_with_column_generation.cc @@ -54,6 +54,7 @@ #include #include // strlen #include +#include "base/unique_ptr.h" #include #include #include