summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/comphelper/sequence.hxx15
1 files changed, 12 insertions, 3 deletions
diff --git a/include/comphelper/sequence.hxx b/include/comphelper/sequence.hxx
index 68c361c6282f..8fba7b8722b1 100644
--- a/include/comphelper/sequence.hxx
+++ b/include/comphelper/sequence.hxx
@@ -283,10 +283,10 @@ namespace comphelper
truncated. There's currently no measure to prevent or detect
precision loss, overflow or truncation.
*/
- template < typename DstType, typename SrcType >
- inline css::uno::Sequence< DstType > containerToSequence( const SrcType& i_Container )
+ template < typename DstElementType, typename SrcType >
+ inline css::uno::Sequence< DstElementType > containerToSequence( const SrcType& i_Container )
{
- css::uno::Sequence< DstType > result( i_Container.size() );
+ css::uno::Sequence< DstElementType > result( i_Container.size() );
::std::copy( i_Container.begin(), i_Container.end(), result.getArray() );
return result;
}
@@ -300,6 +300,15 @@ namespace comphelper
return result;
}
+ // handle arrays
+ template<typename SrcElementType, std::size_t SrcSize>
+ inline css::uno::Sequence< SrcElementType > containerToSequence( SrcElementType const (&i_Array)[ SrcSize ] )
+ {
+ css::uno::Sequence< SrcElementType > result( SrcSize );
+ ::std::copy( std::begin(i_Array), std::end(i_Array), result.getArray() );
+ return result;
+ }
+
template <typename T>
inline css::uno::Sequence<T> containerToSequence(
::std::vector<T> const& v )