Add a comment about default constructed reference counts= Change-Id: Ia6b8a75144755d9bcf05c893bb97a1e207da6b0f
diff --git a/internal/ceres/problem_impl.cc b/internal/ceres/problem_impl.cc index 07da550..ae77c0b 100644 --- a/internal/ceres/problem_impl.cc +++ b/internal/ceres/problem_impl.cc
@@ -340,6 +340,9 @@ } if (options_.cost_function_ownership == TAKE_OWNERSHIP) { + // Increment the reference count, creating an entry in the table if + // needed. Note: C++ maps guarantee that new entries have default + // constructed values; this implies integers are zero initialized. ++cost_function_ref_count_[cost_function]; }