summaryrefslogtreecommitdiffstats
path: root/include/comphelper
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2016-11-09 10:57:28 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2016-11-10 06:52:26 +0000
commitee0e713b5333dd363e443bf471ecb5cecec09d17 (patch)
tree481a53fcbd72e822ad64d3c83309d1c0d6f5be75 /include/comphelper
parentloplugin:expandablemethods in comphelper..cppuhelper (diff)
downloadcore-ee0e713b5333dd363e443bf471ecb5cecec09d17.tar.gz
core-ee0e713b5333dd363e443bf471ecb5cecec09d17.zip
make comphelper::sequenceToContainer a little smarter
so we don't have to specify the source type Change-Id: I4106705a39874a8043f0f294a11374404d6cfc3a Reviewed-on: https://gerrit.libreoffice.org/30713 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'include/comphelper')
-rw-r--r--include/comphelper/sequence.hxx9
1 files changed, 9 insertions, 0 deletions
diff --git a/include/comphelper/sequence.hxx b/include/comphelper/sequence.hxx
index bb1b1e81ba61..68c361c6282f 100644
--- a/include/comphelper/sequence.hxx
+++ b/include/comphelper/sequence.hxx
@@ -340,6 +340,15 @@ namespace comphelper
return result;
}
+ // this one does better type deduction, but does not allow us to copy into a different element type
+ template < typename DstType >
+ inline DstType sequenceToContainer( const css::uno::Sequence< typename DstType::value_type >& i_Sequence )
+ {
+ DstType result( i_Sequence.getLength() );
+ ::std::copy( i_Sequence.begin(), i_Sequence.end(), result.begin() );
+ return result;
+ }
+
/** Copy from a Sequence into an existing container
This potentially saves a needless extra copy operation over