summaryrefslogtreecommitdiff
path: root/comphelper/inc/comphelper/InlineContainer.hxx
diff options
context:
space:
mode:
authorVladimir Glazounov <vg@openoffice.org>2007-05-22 19:18:49 +0000
committerVladimir Glazounov <vg@openoffice.org>2007-05-22 19:18:49 +0000
commit4656f7b0c6c28629fb89e9b89259317016a5eb54 (patch)
treeb8789e69dfd4701af03926ae7ef61f4cf51ce0a3 /comphelper/inc/comphelper/InlineContainer.hxx
parent96fcabe6134810b7a0fc4b900dfd3974339e0be2 (diff)
INTEGRATION: CWS chart2mst3 (1.2.34); FILE MERGED
2006/01/27 09:43:51 bm 1.2.34.1: +MakeSet, +operator() with another map
Diffstat (limited to 'comphelper/inc/comphelper/InlineContainer.hxx')
-rw-r--r--comphelper/inc/comphelper/InlineContainer.hxx35
1 files changed, 33 insertions, 2 deletions
diff --git a/comphelper/inc/comphelper/InlineContainer.hxx b/comphelper/inc/comphelper/InlineContainer.hxx
index ce205d25d707..9936d4ddad2f 100644
--- a/comphelper/inc/comphelper/InlineContainer.hxx
+++ b/comphelper/inc/comphelper/InlineContainer.hxx
@@ -4,9 +4,9 @@
*
* $RCSfile: InlineContainer.hxx,v $
*
- * $Revision: 1.2 $
+ * $Revision: 1.3 $
*
- * last change: $Author: kz $ $Date: 2005-11-02 14:06:44 $
+ * last change: $Author: vg $ $Date: 2007-05-22 20:18:49 $
*
* The Contents of this file are made available subject to
* the terms of GNU Lesser General Public License Version 2.1.
@@ -39,6 +39,7 @@
#include <vector>
#include <map>
+#include <set>
namespace comphelper
{
@@ -93,6 +94,30 @@ public:
// ----------------------------------------
+/** Creates a set which contains an arbitrary number of elements.
+
+ usage:
+
+ set< t > aSet( MakeSet< t >( t_1 )( t_2 )...( t_n ) );
+ */
+template < typename T >
+class MakeSet : public ::std::set< T >
+{
+public:
+ explicit MakeSet(const T &a)
+ : ::std::set< T >()
+ {
+ insert(this->end(), a);
+ }
+ MakeSet &operator()(const T &a)
+ {
+ this->insert(this->end(), a);
+ return *this;
+ }
+};
+
+// ----------------------------------------
+
/** usage:
map< k, v > aMap( MakeMap< k, v >
@@ -118,6 +143,12 @@ public:
this->insert( value_type( k, v ) );
return *this;
}
+
+ MakeMap &operator()( const MakeMap& rSource )
+ {
+ this->insert(rSource.begin(),rSource.end());
+ return *this;
+ }
};
} // namespace comphelper