diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2015-11-20 13:39:52 +0100 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2015-11-20 13:39:52 +0100 |
commit | b8793748b0eaaa3fe405587fcb2a3021adab833b (patch) | |
tree | 39b683691a8b8089831939a3a84ba1d62d614cb5 /include | |
parent | e3990370f832c8a69d1b6b22ec315dc0616d5535 (diff) |
Seems more natural to pass a homogenous list by initializer_list
...than by template parameter pack (even if that requires using ServiceDecl*, as
initializer_list cannot take reference types)
Change-Id: Ia986201b52d8daedfe925f132ebc79bc2c0ba378
Diffstat (limited to 'include')
-rw-r--r-- | include/comphelper/servicedecl.hxx | 31 |
1 files changed, 4 insertions, 27 deletions
diff --git a/include/comphelper/servicedecl.hxx b/include/comphelper/servicedecl.hxx index 4447364d005a..077d38e714f4 100644 --- a/include/comphelper/servicedecl.hxx +++ b/include/comphelper/servicedecl.hxx @@ -26,6 +26,7 @@ #include <uno/environment.h> #include <functional> +#include <initializer_list> namespace comphelper { namespace service_decl { @@ -332,33 +333,9 @@ struct inheritingClass_ : public serviceimpl_base< detail::InheritingServiceImpl explicit inheritingClass_( PostProcessFuncT const& postProcessFunc ) : baseT( postProcessFunc ) {} }; -// component_... helpers with arbitrary service declarations: - -template< typename T > -inline void* component_getFactoryHelper( const sal_Char* pImplName, void* pRet, - const T& s ) -{ - if( pRet == nullptr ) - return s.getFactory( pImplName ); - return pRet; -} - -template< typename T, typename... Args > -inline void* component_getFactoryHelper( const sal_Char* pImplName, void* pRet, - const T& s, const Args&... args ) -{ - if( pRet == nullptr ) - return component_getFactoryHelper( pImplName, s.getFactory( pImplName ), args... ); - return pRet; -} - -template< typename... Args > -inline void* component_getFactoryHelper( const sal_Char* pImplName, - const Args&... args ) -{ - void* pRet = nullptr; - return component_getFactoryHelper( pImplName, pRet, args... ); -} +COMPHELPER_DLLPUBLIC +void* component_getFactoryHelper( const sal_Char* pImplName, + std::initializer_list<ServiceDecl const *> args ); } // namespace service_decl } // namespace comphelper |