-
Notifications
You must be signed in to change notification settings - Fork 4.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #43988 from makortel/esproducerLambda
Fix ESProducerExternalWork::setWhatAcquiredProducedWithLambda()
- Loading branch information
Showing
4 changed files
with
118 additions
and
43 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
102 changes: 62 additions & 40 deletions
102
FWCore/Framework/interface/es_impl/ReturnArgumentTypes.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,45 +1,67 @@ | ||
#ifndef FWCore_Framework_interface_es_impl_ReturnArgumentTypes_h | ||
#define FWCore_Framework_interface_es_impl_ReturnArgumentTypes_h | ||
|
||
namespace edm::eventsetup::impl { | ||
template <typename F> | ||
struct ReturnArgumentTypesImpl; | ||
|
||
// function pointer | ||
template <typename R, typename T> | ||
struct ReturnArgumentTypesImpl<R (*)(T const&)> { | ||
using argument_type = T; | ||
using return_type = R; | ||
}; | ||
|
||
// mutable functor/lambda | ||
template <typename R, typename T, typename O> | ||
struct ReturnArgumentTypesImpl<R (O::*)(T const&)> { | ||
using argument_type = T; | ||
using return_type = R; | ||
}; | ||
|
||
// const functor/lambda | ||
template <typename R, typename T, typename O> | ||
struct ReturnArgumentTypesImpl<R (O::*)(T const&) const> { | ||
using argument_type = T; | ||
using return_type = R; | ||
}; | ||
|
||
template <typename F, typename = void> | ||
struct ReturnArgumentTypes; | ||
|
||
template <typename F> | ||
struct ReturnArgumentTypes<F, std::enable_if_t<std::is_class_v<F>>> { | ||
using argument_type = typename ReturnArgumentTypesImpl<decltype(&F::operator())>::argument_type; | ||
using return_type = typename ReturnArgumentTypesImpl<decltype(&F::operator())>::return_type; | ||
}; | ||
|
||
template <typename F> | ||
struct ReturnArgumentTypes<F, std::enable_if_t<std::is_pointer_v<F>>> { | ||
using argument_type = typename ReturnArgumentTypesImpl<F>::argument_type; | ||
using return_type = typename ReturnArgumentTypesImpl<F>::return_type; | ||
}; | ||
} // namespace edm::eventsetup::impl | ||
namespace edm { | ||
class WaitingTaskWithArenaHolder; | ||
|
||
namespace eventsetup::impl { | ||
template <typename F> | ||
struct ReturnArgumentTypesImpl; | ||
|
||
// function pointer | ||
template <typename R, typename T> | ||
struct ReturnArgumentTypesImpl<R (*)(T const&)> { | ||
using argument_type = T; | ||
using return_type = R; | ||
}; | ||
template <typename R, typename T> | ||
struct ReturnArgumentTypesImpl<R (*)(T const&, WaitingTaskWithArenaHolder)> { | ||
using argument_type = T; | ||
using return_type = R; | ||
}; | ||
|
||
// mutable functor/lambda | ||
template <typename R, typename T, typename O> | ||
struct ReturnArgumentTypesImpl<R (O::*)(T const&)> { | ||
using argument_type = T; | ||
using return_type = R; | ||
}; | ||
template <typename R, typename T, typename O> | ||
struct ReturnArgumentTypesImpl<R (O::*)(T const&, WaitingTaskWithArenaHolder)> { | ||
using argument_type = T; | ||
using return_type = R; | ||
}; | ||
|
||
// const functor/lambda | ||
template <typename R, typename T, typename O> | ||
struct ReturnArgumentTypesImpl<R (O::*)(T const&) const> { | ||
using argument_type = T; | ||
using return_type = R; | ||
}; | ||
template <typename R, typename T, typename O> | ||
struct ReturnArgumentTypesImpl<R (O::*)(T const&, WaitingTaskWithArenaHolder) const> { | ||
using argument_type = T; | ||
using return_type = R; | ||
}; | ||
|
||
////////// | ||
|
||
template <typename F, typename = void> | ||
struct ReturnArgumentTypes; | ||
|
||
template <typename F> | ||
struct ReturnArgumentTypes<F, std::enable_if_t<std::is_class_v<F>>> { | ||
using argument_type = typename ReturnArgumentTypesImpl<decltype(&F::operator())>::argument_type; | ||
using return_type = typename ReturnArgumentTypesImpl<decltype(&F::operator())>::return_type; | ||
}; | ||
|
||
template <typename F> | ||
struct ReturnArgumentTypes<F, std::enable_if_t<std::is_pointer_v<F>>> { | ||
using argument_type = typename ReturnArgumentTypesImpl<F>::argument_type; | ||
using return_type = typename ReturnArgumentTypesImpl<F>::return_type; | ||
}; | ||
|
||
} // namespace eventsetup::impl | ||
} // namespace edm | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters