Project

General

Profile

Feature #23320

Support associative containers of key type art::InputTag

Added by Andrei Gaponenko about 2 months ago. Updated 6 days ago.

Status:
Closed
Priority:
Normal
Assignee:
Target version:
Start date:
09/24/2019
Due date:
% Done:

100%

Estimated time:
2.00 h
Spent time:
Scope:
Internal
Experiment:
Mu2e
SSI Package:
art
Duration:

Description

Hello,

an std::set<art::InputTag> does not compile because of the lack of 'operator<'.
Can it please be added?

Andrei

History

#1 Updated by Kyle Knoepfel about 2 months ago

  • Description updated (diff)

#2 Updated by Kyle Knoepfel about 2 months ago

  • Status changed from New to Under Discussion

#3 Updated by Kyle Knoepfel about 2 months ago

Andrei, is the motivation for this request that you want to compare a user-specified tag against a set of allowed tags?

#4 Updated by Kyle Knoepfel about 2 months ago

  • Status changed from Under Discussion to Feedback

#5 Updated by Kyle Knoepfel 9 days ago

  • Estimated time set to 2.00 h
  • Target version set to 3.04.00
  • Assignee set to Kyle Knoepfel
  • Status changed from Feedback to Assigned

We are fine with implementing a comparison operation, although its spelling may be something other than 'operator<()', or 'operator<()' may be implemented in terms of a named function that can alternatively be specified when specifying/constructing the std::set template arguments.

#6 Updated by Kyle Knoepfel 8 days ago

  • % Done changed from 0 to 100
  • Status changed from Assigned to Resolved
  • SSI Package art added

The chosen approach was to specialize of std::less<art::InputTag>, which is what std::set and std::map use as default custom comparators. By choosing this route, we avoid introducing operators '<', '>' (etc.), which do not have a natural meaning for art::InputTag.

Implemented with commit canvas:ed8e1c7e.

#7 Updated by Kyle Knoepfel 8 days ago

  • Subject changed from operator<() for InputTag to Support associative containers of key type art::InputTag

#8 Updated by Kyle Knoepfel 6 days ago

  • Status changed from Resolved to Closed


Also available in: Atom PDF