[SERVER-1338] shared_ptr type is ambiguous and conflict with std::shared_ptr Created: 01/Jul/10  Updated: 12/Jul/16  Resolved: 01/Jul/10

Status: Closed
Project: Core Server
Component/s: Internal Client
Affects Version/s: None
Fix Version/s: 1.5.4

Type: Bug Priority: Minor - P4
Reporter: Mark Sung Assignee: Eliot Horowitz (Inactive)
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Linux 64bit with GCC 4.3.4/4.4.3


Backwards Compatibility: Minor Change
Operating System: Linux
Participants:

 Description   

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



 Comments   
Comment by Eliot Horowitz (Inactive) [ 01/Jul/10 ]

already fixed in master

Generated at Thu Feb 08 02:56:44 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.