Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-1338

shared_ptr type is ambiguous and conflict with std::shared_ptr

    • Type: Icon: Bug Bug
    • Resolution: Done
    • Priority: Icon: Minor - P4 Minor - P4
    • 1.5.4
    • Affects Version/s: None
    • Component/s: Internal Client
    • Labels:
      None
    • Environment:
      Linux 64bit with GCC 4.3.4/4.4.3
    • Minor Change
    • Linux

      Inconsistent namespace prefixing for shared_ptr.

      Sometimes shared_ptr is written "boost::shared_ptr", sometimes it is written "shared_ptr"

      In our organization, we use our own implementation of shared_ptr so we prefer no namespace specification for shared_ptr, or at least a consistent namespace specification.

      For example, in gcc 4.3 or later, there're std::shared_ptr provided along with boost::shared_ptr, so if we using both std and boost namespace, the shared_ptr then becomes an ambiguous type unless one explicit specify std::shared_ptr or boost::shared_ptr. Even worse, these two shared_ptr are not compatible with each other, that is, you can not assign std::shared_ptr to boost::shared_ptr and vice versa.
      So we need a way to consistently determine which version of shared_ptr to use.

      Please consider to modify stdafx.h or pch.h to select shared_ptr by "using std::shared_ptr" or "using boost::shared_ptr". Also remove all "using namespace std" in all headers to avoid ambiguous symbols

            Assignee:
            eliot Eliot Horowitz (Inactive)
            Reporter:
            nctusdk Mark Sung
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: