Replace scoped_ptr with C++11's unique_ptr

Change-Id: Ib5a504c491e3a79af52a95accf009df473470c6b
This commit is contained in:
Keir Mierle
2018-03-30 16:16:59 -07:00
parent fc9336e12a
commit 7c4e8a454e
120 changed files with 427 additions and 728 deletions
+4 -2
View File
@@ -31,7 +31,9 @@
#include "ceres/program.h"
#include <map>
#include <memory>
#include <vector>
#include "ceres/array_utils.h"
#include "ceres/casts.h"
#include "ceres/compressed_row_sparse_matrix.h"
@@ -274,7 +276,7 @@ Program* Program::CreateReducedProgram(
CHECK_NOTNULL(fixed_cost);
CHECK_NOTNULL(error);
scoped_ptr<Program> reduced_program(new Program(*this));
std::unique_ptr<Program> reduced_program(new Program(*this));
if (!reduced_program->RemoveFixedBlocks(removed_parameter_blocks,
fixed_cost,
error)) {
@@ -292,7 +294,7 @@ bool Program::RemoveFixedBlocks(vector<double*>* removed_parameter_blocks,
CHECK_NOTNULL(fixed_cost);
CHECK_NOTNULL(error);
scoped_array<double> residual_block_evaluate_scratch;
std::unique_ptr<double[]> residual_block_evaluate_scratch;
residual_block_evaluate_scratch.reset(
new double[MaxScratchDoublesNeededForEvaluate()]);
*fixed_cost = 0.0;