From b5317b2a41e6369e2804462e2ab73f1447f1533a Mon Sep 17 00:00:00 2001 From: Mike Kaganski Date: Mon, 26 Aug 2019 15:04:47 +0200 Subject: Introduce Sequence::size() instead of specialization of std::size Change-Id: Id0889a1b51449f3812ba875919595a241f4ec56f Reviewed-on: https://gerrit.libreoffice.org/78139 Tested-by: Jenkins Reviewed-by: Mike Kaganski --- include/com/sun/star/uno/Sequence.h | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) (limited to 'include') diff --git a/include/com/sun/star/uno/Sequence.h b/include/com/sun/star/uno/Sequence.h index 78d1124ba504..2ba8c71f8be8 100644 --- a/include/com/sun/star/uno/Sequence.h +++ b/include/com/sun/star/uno/Sequence.h @@ -27,6 +27,7 @@ #include #if defined LIBO_INTERNAL_ONLY +#include #include #endif @@ -151,6 +152,15 @@ public: bool SAL_CALL hasElements() const { return (_pSequence->nElements > 0); } +#if defined LIBO_INTERNAL_ONLY + /** This function allows to use Sequence in cases where std::size is needed, and the like. + + @since LibreOffice 6.4 + */ + sal_uInt32 size() const + { assert(getLength() >= 0); return static_cast(getLength()); } +#endif + /** Gets a pointer to elements array for reading. If the sequence has a length of 0, then the returned pointer is undefined. @@ -272,16 +282,6 @@ inline ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL toUnoSequence( } } -#if defined LIBO_INTERNAL_ONLY -namespace std -{ -template sal_Int32 size(const ::com::sun::star::uno::Sequence& s) -{ - return s.getLength(); -} -} -#endif - /** Gets the meta type of IDL sequence. There are cases (involving templates) where uses of getCppuType are known to -- cgit