Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-08-24 09:50:48

0001 #ifndef FWCore_Framework_interface_es_impl_ReturnArgumentTypes_h
0002 #define FWCore_Framework_interface_es_impl_ReturnArgumentTypes_h
0003 
0004 namespace edm {
0005   class WaitingTaskWithArenaHolder;
0006 
0007   namespace eventsetup::impl {
0008     template <typename F>
0009     struct ReturnArgumentTypesImpl;
0010 
0011     // function pointer
0012     template <typename R, typename T>
0013     struct ReturnArgumentTypesImpl<R (*)(T const&)> {
0014       using argument_type = T;
0015       using return_type = R;
0016     };
0017     template <typename R, typename T>
0018     struct ReturnArgumentTypesImpl<R (*)(T const&, WaitingTaskWithArenaHolder)> {
0019       using argument_type = T;
0020       using return_type = R;
0021     };
0022 
0023     // mutable functor/lambda
0024     template <typename R, typename T, typename O>
0025     struct ReturnArgumentTypesImpl<R (O::*)(T const&)> {
0026       using argument_type = T;
0027       using return_type = R;
0028     };
0029     template <typename R, typename T, typename O>
0030     struct ReturnArgumentTypesImpl<R (O::*)(T const&, WaitingTaskWithArenaHolder)> {
0031       using argument_type = T;
0032       using return_type = R;
0033     };
0034 
0035     // const functor/lambda
0036     template <typename R, typename T, typename O>
0037     struct ReturnArgumentTypesImpl<R (O::*)(T const&) const> {
0038       using argument_type = T;
0039       using return_type = R;
0040     };
0041     template <typename R, typename T, typename O>
0042     struct ReturnArgumentTypesImpl<R (O::*)(T const&, WaitingTaskWithArenaHolder) const> {
0043       using argument_type = T;
0044       using return_type = R;
0045     };
0046 
0047     //////////
0048 
0049     template <typename F>
0050     struct ReturnArgumentTypes;
0051 
0052     template <typename F>
0053       requires std::is_class_v<F>
0054     struct ReturnArgumentTypes<F> {
0055       using argument_type = typename ReturnArgumentTypesImpl<decltype(&F::operator())>::argument_type;
0056       using return_type = typename ReturnArgumentTypesImpl<decltype(&F::operator())>::return_type;
0057     };
0058 
0059     template <typename F>
0060       requires std::is_pointer_v<F>
0061     struct ReturnArgumentTypes<F> {
0062       using argument_type = typename ReturnArgumentTypesImpl<F>::argument_type;
0063       using return_type = typename ReturnArgumentTypesImpl<F>::return_type;
0064     };
0065 
0066   }  // namespace eventsetup::impl
0067 }  // namespace edm
0068 
0069 #endif