Remove using std::string from port.h
Change-Id: I7376f5e7eace22ec1fc05a61eaa858594f08682d
diff --git a/include/ceres/gradient_problem_solver.h b/include/ceres/gradient_problem_solver.h
index 0676d92..1ed1e4a 100644
--- a/include/ceres/gradient_problem_solver.h
+++ b/include/ceres/gradient_problem_solver.h
@@ -81,7 +81,7 @@
// Returns true if the options struct has a valid
// configuration. Returns false otherwise, and fills in *error
// with a message describing the problem.
- bool IsValid(string* error) const;
+ bool IsValid(std::string* error) const;
// Minimizer options ----------------------------------------
LineSearchDirectionType line_search_direction_type;
@@ -269,11 +269,11 @@
// A brief one line description of the state of the solver after
// termination.
- string BriefReport() const;
+ std::string BriefReport() const;
// A full multiline description of the state of the solver after
// termination.
- string FullReport() const;
+ std::string FullReport() const;
bool IsSolutionUsable() const;
@@ -281,7 +281,7 @@
TerminationType termination_type;
// Reason why the solver terminated.
- string message;
+ std::string message;
// Cost of the problem (value of the objective function) before
// the optimization.
diff --git a/include/ceres/internal/port.h b/include/ceres/internal/port.h
index 24eca05..6cee7ba 100644
--- a/include/ceres/internal/port.h
+++ b/include/ceres/internal/port.h
@@ -34,8 +34,6 @@
// This file needs to compile as c code.
#ifdef __cplusplus
-#include <string>
-
#include "ceres/internal/config.h"
#if defined(CERES_TR1_MEMORY_HEADER)
@@ -46,10 +44,6 @@
namespace ceres {
-// This is necessary to properly handle the case that there is a different
-// "string" implementation in the global namespace.
-using std::string;
-
#if defined(CERES_TR1_SHARED_PTR)
using std::tr1::shared_ptr;
#else
diff --git a/include/ceres/solver.h b/include/ceres/solver.h
index dc06151..cfa2974 100644
--- a/include/ceres/solver.h
+++ b/include/ceres/solver.h
@@ -141,7 +141,7 @@
// Returns true if the options struct has a valid
// configuration. Returns false otherwise, and fills in *error
// with a message describing the problem.
- bool IsValid(string* error) const;
+ bool IsValid(std::string* error) const;
// Minimizer options ----------------------------------------
@@ -683,7 +683,7 @@
// non-empty if trust_region_minimizer_iterations_to_dump is
// non-empty and trust_region_problem_dump_format_type is not
// CONSOLE.
- string trust_region_problem_dump_directory;
+ std::string trust_region_problem_dump_directory;
DumpFormatType trust_region_problem_dump_format_type;
// Finite differences options ----------------------------------------------
@@ -755,11 +755,11 @@
// A brief one line description of the state of the solver after
// termination.
- string BriefReport() const;
+ std::string BriefReport() const;
// A full multiline description of the state of the solver after
// termination.
- string FullReport() const;
+ std::string FullReport() const;
bool IsSolutionUsable() const;
@@ -769,7 +769,7 @@
TerminationType termination_type;
// Reason why the solver terminated.
- string message;
+ std::string message;
// Cost of the problem (value of the objective function) before
// the optimization.
diff --git a/include/ceres/types.h b/include/ceres/types.h
index 8915188..c9ee34c 100644
--- a/include/ceres/types.h
+++ b/include/ceres/types.h
@@ -416,65 +416,65 @@
CERES_EXPORT const char* LinearSolverTypeToString(
LinearSolverType type);
-CERES_EXPORT bool StringToLinearSolverType(string value,
+CERES_EXPORT bool StringToLinearSolverType(std::string value,
LinearSolverType* type);
CERES_EXPORT const char* PreconditionerTypeToString(PreconditionerType type);
-CERES_EXPORT bool StringToPreconditionerType(string value,
+CERES_EXPORT bool StringToPreconditionerType(std::string value,
PreconditionerType* type);
CERES_EXPORT const char* VisibilityClusteringTypeToString(
VisibilityClusteringType type);
-CERES_EXPORT bool StringToVisibilityClusteringType(string value,
+CERES_EXPORT bool StringToVisibilityClusteringType(std::string value,
VisibilityClusteringType* type);
CERES_EXPORT const char* SparseLinearAlgebraLibraryTypeToString(
SparseLinearAlgebraLibraryType type);
CERES_EXPORT bool StringToSparseLinearAlgebraLibraryType(
- string value,
+ std::string value,
SparseLinearAlgebraLibraryType* type);
CERES_EXPORT const char* DenseLinearAlgebraLibraryTypeToString(
DenseLinearAlgebraLibraryType type);
CERES_EXPORT bool StringToDenseLinearAlgebraLibraryType(
- string value,
+ std::string value,
DenseLinearAlgebraLibraryType* type);
CERES_EXPORT const char* TrustRegionStrategyTypeToString(
TrustRegionStrategyType type);
-CERES_EXPORT bool StringToTrustRegionStrategyType(string value,
+CERES_EXPORT bool StringToTrustRegionStrategyType(std::string value,
TrustRegionStrategyType* type);
CERES_EXPORT const char* DoglegTypeToString(DoglegType type);
-CERES_EXPORT bool StringToDoglegType(string value, DoglegType* type);
+CERES_EXPORT bool StringToDoglegType(std::string value, DoglegType* type);
CERES_EXPORT const char* MinimizerTypeToString(MinimizerType type);
-CERES_EXPORT bool StringToMinimizerType(string value, MinimizerType* type);
+CERES_EXPORT bool StringToMinimizerType(std::string value, MinimizerType* type);
CERES_EXPORT const char* LineSearchDirectionTypeToString(
LineSearchDirectionType type);
-CERES_EXPORT bool StringToLineSearchDirectionType(string value,
+CERES_EXPORT bool StringToLineSearchDirectionType(std::string value,
LineSearchDirectionType* type);
CERES_EXPORT const char* LineSearchTypeToString(LineSearchType type);
-CERES_EXPORT bool StringToLineSearchType(string value, LineSearchType* type);
+CERES_EXPORT bool StringToLineSearchType(std::string value, LineSearchType* type);
CERES_EXPORT const char* NonlinearConjugateGradientTypeToString(
NonlinearConjugateGradientType type);
CERES_EXPORT bool StringToNonlinearConjugateGradientType(
- string value,
+ std::string value,
NonlinearConjugateGradientType* type);
CERES_EXPORT const char* LineSearchInterpolationTypeToString(
LineSearchInterpolationType type);
CERES_EXPORT bool StringToLineSearchInterpolationType(
- string value,
+ std::string value,
LineSearchInterpolationType* type);
CERES_EXPORT const char* CovarianceAlgorithmTypeToString(
CovarianceAlgorithmType type);
CERES_EXPORT bool StringToCovarianceAlgorithmType(
- string value,
+ std::string value,
CovarianceAlgorithmType* type);
CERES_EXPORT const char* TerminationTypeToString(TerminationType type);