Skip to content
This repository has been archived by the owner on Oct 26, 2018. It is now read-only.

Commit

Permalink
Change the defaults for shared_ptr.
Browse files Browse the repository at this point in the history
By default shared_ptr is now assumed to be
in the standard <memory> header and in the
std namespace.

Previously the way the ifdefs were structured if the appropriate
variable was not defined, it would default to <t1/memory>.

The new defaults are more future proof.

Change-Id: If457806191196be2b6425b8289ea7a3488a27445
  • Loading branch information
sandwichmaker committed Apr 25, 2014
1 parent bb05be3 commit e55596f
Showing 1 changed file with 5 additions and 8 deletions.
13 changes: 5 additions & 8 deletions include/ceres/internal/port.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,12 @@

#include <string>

#if defined(CERES_STD_SHARED_PTR) || defined(CERES_STD_SHARED_PTR_IN_TR1_NAMESPACE)
#include <memory>
#else
#if defined(CERES_TR1_SHARED_PTR)
#include <tr1/memory>
#else
#include <memory>
#endif


namespace ceres {

// It is unfortunate that this import of the entire standard namespace is
Expand All @@ -52,12 +51,10 @@ using namespace std;
// "string" implementation in the global namespace.
using std::string;

#if defined(CERES_STD_SHARED_PTR)
using std::shared_ptr;
#endif

#if defined(CERES_STD_SHARED_PTR_IN_TR1_NAMESPACE) || defined(SHARED_PTR_IN_TR1_NAMESPACE)
using std::tr1::shared_ptr;
#else
using std::shared_ptr;
#endif

} // namespace ceres
Expand Down

0 comments on commit e55596f

Please sign in to comment.