From 5efd35b1006cc14893a1e5a104e6f15a88dec5f2 Mon Sep 17 00:00:00 2001 From: Reinhard Pfau Date: Fri, 1 Aug 2008 12:47:15 +0000 Subject: [PATCH] libi2ncommon: (reinhard) changes for g++ 4.3.1 --- configure.in | 2 +- src/containerfunc.hpp | 42 +++++++++++++++++++++++++++--------------- src/daemonfunc.cpp | 1 + src/filefunc.cpp | 1 + src/logfunc.cpp | 1 + src/oftmpstream.cpp | 1 + src/stringfunc.cpp | 1 + src/timefunc.cpp | 1 + 8 files changed, 34 insertions(+), 16 deletions(-) diff --git a/configure.in b/configure.in index 479323b..f14562c 100644 --- a/configure.in +++ b/configure.in @@ -3,7 +3,7 @@ AC_INIT(configure.in) AM_CONFIG_HEADER(config.h) AM_INIT_AUTOMAKE(libi2ncommon, 1.0) -LIBI2NCOMMON_LIB_VERSION=1:0:0 +LIBI2NCOMMON_LIB_VERSION=2:0:1 AC_SUBST(LIBI2NCOMMON_LIB_VERSION) diff --git a/src/containerfunc.hpp b/src/containerfunc.hpp index 7c7b459..341505d 100644 --- a/src/containerfunc.hpp +++ b/src/containerfunc.hpp @@ -28,59 +28,71 @@ template class MapFiller { std::map & MapRef; - + public: MapFiller( std::map & map_ref) : MapRef(map_ref) { } - + MapFiller& operator () (const K& key, const V& value) { MapRef[key]= value; return *this; } - + }; // eo class MapFiller /** * convenience class to fill values into a container (using push_back). */ -template class C= std::list > +template< + typename T, + template< typename, typename> class C= std::list, + typename Alloc = std::allocator< T > +> class PushBackFiller { - C &CRef; + C< T, Alloc > &CRef; public: - PushBackFiller( C & c ) + PushBackFiller( C & c ) : CRef(c) {} - + PushBackFiller& operator () (const T& value) { CRef.push_back(value); return *this; } // eo operator () - + }; // eo class PushBackFiller -template< typename T, template class C > -PushBackFiller< T, C > get_push_back_filler( C< T >& c) +template< + typename T, + template< typename, typename > class C, + typename Alloc +> +PushBackFiller< T, C, Alloc > get_push_back_filler( C< T, Alloc >& c) { - return PushBackFiller< T, C >(c); -} // eo get_push_back_filler(C< T >&) + return PushBackFiller< T, C, Alloc >(c); +} // eo get_push_back_filler(C< T, Alloc >&) /** * convenience class for transient construction of a container including values. */ -template class C= std::list > +template< + typename T, + template< typename, typename> class C= std::list, + typename Alloc = std::allocator< T > +> class TransientPushBackFiller { - C< T > MyC; + C< T, Alloc > MyC; public: - typedef C< T > CType; + typedef C< T, Alloc > CType; TransientPushBackFiller() {} diff --git a/src/daemonfunc.cpp b/src/daemonfunc.cpp index 7500754..d6ecad9 100644 --- a/src/daemonfunc.cpp +++ b/src/daemonfunc.cpp @@ -5,6 +5,7 @@ ***************************************************************************/ #include #include +#include #include #include diff --git a/src/filefunc.cpp b/src/filefunc.cpp index a8d60fe..4b67c47 100644 --- a/src/filefunc.cpp +++ b/src/filefunc.cpp @@ -20,6 +20,7 @@ #include #include #include +#include #include #include "filefunc.hxx" diff --git a/src/logfunc.cpp b/src/logfunc.cpp index 2f40ae6..ed88ef7 100644 --- a/src/logfunc.cpp +++ b/src/logfunc.cpp @@ -19,6 +19,7 @@ #include #include #include +#include #include #include diff --git a/src/oftmpstream.cpp b/src/oftmpstream.cpp index d847cd7..4d764e3 100644 --- a/src/oftmpstream.cpp +++ b/src/oftmpstream.cpp @@ -3,6 +3,7 @@ #include #include #include +#include #include diff --git a/src/stringfunc.cpp b/src/stringfunc.cpp index bf6567d..c2badcb 100644 --- a/src/stringfunc.cpp +++ b/src/stringfunc.cpp @@ -9,6 +9,7 @@ #include #include #include +#include #include #include diff --git a/src/timefunc.cpp b/src/timefunc.cpp index 6792e20..7713298 100644 --- a/src/timefunc.cpp +++ b/src/timefunc.cpp @@ -19,6 +19,7 @@ #include #include +#include #include #include -- 1.7.1