[med-svn] [SCM] aghermann branch, master, updated. c0bd21ca8eb529ade7e0c7aad22951a308a8dc8f

Andrei Zavada johnhommer at gmail.com
Wed May 1 00:09:33 UTC 2013


The following commit has been merged in the master branch:
commit 9c53b4a28c106fd091fa7885e6bc5f67a5946a4a
Author: Andrei Zavada <johnhommer at gmail.com>
Date:   Thu Apr 25 15:25:32 2013 +0300

    new file common/containers.hh

diff --git a/src/common/Makefile.am b/src/common/Makefile.am
index 14c1b55..729016d 100644
--- a/src/common/Makefile.am
+++ b/src/common/Makefile.am
@@ -22,6 +22,7 @@ BUILT_SOURCES := \
 	string.hh.gch \
 	globals.hh.gch \
 	alg.hh.gch \
+	containers.hh.gch \
 	fs.hh.gch \
 	subject_id.hh.gch
 
diff --git a/src/common/containers.hh b/src/common/containers.hh
new file mode 100644
index 0000000..75d1a44
--- /dev/null
+++ b/src/common/containers.hh
@@ -0,0 +1,57 @@
+/*
+ *       File name:  common/containers.hh
+ *         Project:  Aghermann
+ *          Author:  Andrei Zavada <johnhommer at gmail.com>
+ * Initial version:  2013-04-25
+ *
+ *         Purpose:  misc supporting algorithms (containers)
+ *
+ *         License:  GPL
+ */
+
+#ifndef _AGH_COMMON_CONTAINERS_H
+#define _AGH_COMMON_CONTAINERS_H
+
+#include <list>
+#include <forward_list>
+#include <vector>
+
+#if HAVE_CONFIG_H && !defined(VERSION)
+#  include "config.h"
+#endif
+
+using namespace std;
+
+namespace agh {
+namespace alg {
+
+template <typename T>
+bool
+member( const T& x, const list<T>& v)
+{
+	return any( v.begin(), v.end(), x);
+}
+
+template <typename T>
+bool
+member( const T& x, const forward_list<T>& v)
+{
+	return any( v.begin(), v.end(), x);
+}
+
+template <typename T>
+bool
+member( const T& x, const vector<T>& v)
+{
+	return any( v.begin(), v.end(), x);
+}
+
+} // namespace alg
+} // namespace agh
+
+#endif // _AGH_COMMON_ALG_H
+
+// Local Variables:
+// Mode: c++
+// indent-tabs-mode: 8
+// End:

-- 
Sleep experiment manager



More information about the debian-med-commit mailing list