diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2015-04-01 08:30:19 +0200 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2015-04-01 08:30:19 +0200 |
commit | bb9003c7f8f8dbe30fef041473dadcac37075df2 (patch) | |
tree | a7b550fb6d468717cc5fa6380ea1bf7860717af0 /include | |
parent | 2302e9eb8a161abaf5899288b4e1c689f5a1ff07 (diff) |
Make cppu::UnoType<decltype(x)>::get() work when x is of reference type
...using C++11-only std::remove_reference, but decltype is also only C++11, so
3rd party C++03 code should have no need for it anyway. (Commits acutally
making use of it to follow shortly.)
Change-Id: I8dd7a64ca73d2082a3e7b74d3599848e65e81da5
Diffstat (limited to 'include')
-rw-r--r-- | include/cppu/unotype.hxx | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/include/cppu/unotype.hxx b/include/cppu/unotype.hxx index 8870cd508c7c..7c4d37792fb8 100644 --- a/include/cppu/unotype.hxx +++ b/include/cppu/unotype.hxx @@ -21,6 +21,11 @@ #define INCLUDED_CPPU_UNOTYPE_HXX #include <sal/config.h> + +#if __cplusplus >= 201103L +#include <type_traits> +#endif + #include <sal/types.h> #include <typelib/typeclass.h> #include <typelib/typedescription.h> @@ -264,7 +269,13 @@ template< typename T > class UnoType { public: static inline ::com::sun::star::uno::Type const & get() { using namespace ::cppu::detail; - return cppu_detail_getUnoType(static_cast< T * >(0)); +#if __cplusplus >= 201103L + typedef typename std::remove_reference<T>::type T1; + // for certain uses of UnoType<decltype(x)> +#else + typedef T T1; +#endif + return cppu_detail_getUnoType(static_cast< T1 * >(0)); } private: |