Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move bool operator>(l1t::Jet&, l1t::Jet&) to l1t namespace #6582

Merged
merged 1 commit into from Nov 25, 2014

Conversation

davidlt
Copy link
Contributor

@davidlt davidlt commented Nov 25, 2014

The following line in BitonicSort.h

bool lComp( *lFirst > *lSecond );

depends on template argument type. Thus argument-dependent lookup (ADL)
is being used here to find bool operator>(l1t::Jet&, l1t::Jet&).

ADL is done once all argument types are known, i.e., in template
instantiation location. It this case it happens in a few places from
BitonicSort.h and Stage2Layer2JetAlgorithmFirmwareImp1.cc.
They all require template specialization: BitonicSort<l1t::Jet>.

The operator is not found on the first look up (unqualified lookup),
because it's delcared after template delcaration. It's also not found in
second look up (ADL), because it's not in a class's namespace, but in a
global namespace.

The patch adds bool operator>(l1t::Jet&, l1t::Jet&) to l1t namespace
to allow ADL to find the operator.

Resolves error with Clang.

Signed-off-by: David Abdurachmanov David.Abdurachmanov@cern.ch

The following line in `BitonicSort.h`

    bool lComp( *lFirst > *lSecond );

depends on template argument type. Thus argument-dependent lookup (ADL)
is being used here to find `bool operator>(l1t::Jet&, l1t::Jet&)`.

ADL is done once all argument types are known, i.e., in template
instantiation location. It this case it happens in a few places from
`BitonicSort.h` and `Stage2Layer2JetAlgorithmFirmwareImp1.cc`.
They all require template specialization: `BitonicSort<l1t::Jet>`.

The operator is not found on the first look up (unqualified lookup),
because it's delcared after template delcaration. It's also not found in
second look up (ADL), because it's not in a class's namespace, but in a
global namespace.

The patch adds `bool operator>(l1t::Jet&, l1t::Jet&)` to `l1t` namespace
to allow ADL to find the operator.

Resolves error with Clang.

Signed-off-by: David Abdurachmanov <David.Abdurachmanov@cern.ch>
@cmsbuild
Copy link
Contributor

A new Pull Request was created by @davidlt for CMSSW_7_4_X.

Move bool operator>(l1t::Jet&, l1t::Jet&) to l1t namespace

It involves the following packages:

L1Trigger/L1TCalorimeter

@cmsbuild, @nclopezo, @mulhearn can you please review it and eventually sign? Thanks.
You can sign-off by replying to this message having '+1' in the first line of your reply.
You can reject by replying to this message having '-1' in the first line of your reply.

@cmsbuild
Copy link
Contributor

@mulhearn
Copy link
Contributor

+1

@cmsbuild
Copy link
Contributor

This pull request is fully signed and it will be integrated in one of the next CMSSW_7_4_X IBs unless changes (tests are also fine). This pull request will be automatically merged.

cmsbuild added a commit that referenced this pull request Nov 25, 2014
Move bool operator>(l1t::Jet&, l1t::Jet&) to l1t namespace
@cmsbuild cmsbuild merged commit 8540256 into cms-sw:CMSSW_7_4_X Nov 25, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants