Warning: Can't synchronize with repository "(default)" (/home/git/ome.git does not appear to be a Git repository.). Look in the Trac log for more information.
Notice: In order to edit this ticket you need to be either: a Product Owner, The owner or the reporter of the ticket, or, in case of a Task not yet assigned, a team_member"

Task #12174 (closed)

Opened 10 years ago

Closed 9 years ago

C++: Revisit use of std namespace in compat headers

Reported by: rleigh Owned by: rleigh
Priority: minor Milestone: 5.x
Component: Bio-Formats Version: 5.0.1
Keywords: cpp Cc:
Resources: n.a. Referenced By: n.a.
References: n.a. Remaining Time: n.a.
Sprint: n.a.

Description

The compat headers exist to provide a consistent set of types which work across different compilers. The current strategy is to use the C++ type from the std:: namespace, where available, and if not available fall back to using the corresponding type from the boost:: namespace (or potentially elsewhere).

This is all working fine, however when it comes to exposing these types to users of the library, we are actually polluting the std:: namespace with the boost types. Now, this does only occur on old systems with older standard libraries, but this could be considered a bit antisocial. These types will certainly leak into the APIs and implementations of any downstream consumer (even it it's really boost under the hood).

We might want to import all std:: or boost:: types into the ome:: (or ome::compat::) namespace so that we can use a consistent name for each type internally and externally, which won't pollute std::. Thus, for example:

std::shared_ptr (which might be in reality boost::shared_ptr)
would be ome::shared_ptr (or ome::compat::shared_ptr).

Change History (2)

comment:1 Changed 10 years ago by rleigh

  • Keywords cpp added

comment:2 Changed 9 years ago by rleigh

  • Resolution set to fixed
  • Status changed from new to closed
Note: See TracTickets for help on using tickets. You may also have a look at Agilo extensions to the ticket.

1.3.13-PRO © 2008-2011 Agilo Software all rights reserved (this page was served in: 0.70691 sec.)

We're Hiring!