aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2006-01-19 02:29:55 +0000
committerAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2006-01-19 02:29:55 +0000
commit4f672a6d76b33508d51eae39040f5e35c751fef6 (patch)
tree9b6907373a2adb8894a8e99ae6e6890e27c5c76e
parent523561e7908d2d5bbe05b84ea2c1d9c404728b12 (diff)
downloadpaludis-4f672a6d76b33508d51eae39040f5e35c751fef6.tar.gz
paludis-4f672a6d76b33508d51eae39040f5e35c751fef6.tar.xz
Fixes for icc: define and use next() rather than ++ to advance pointers, add in a few new includes.
-rw-r--r--paludis/default_config.cc7
-rw-r--r--paludis/files.m41
-rw-r--r--paludis/filter_insert_iterator_TEST.cc1
-rw-r--r--paludis/iterator_utilities.cc4
-rw-r--r--paludis/iterator_utilities.hh41
5 files changed, 51 insertions, 3 deletions
diff --git a/paludis/default_config.cc b/paludis/default_config.cc
index 74c995d..1df5aa5 100644
--- a/paludis/default_config.cc
+++ b/paludis/default_config.cc
@@ -12,6 +12,7 @@
#include "tokeniser.hh"
#include "line_config_file.hh"
#include "create_insert_iterator.hh"
+#include "iterator_utilities.hh"
#include <fstream>
#include <algorithm>
@@ -108,12 +109,12 @@ DefaultConfig::DefaultConfig()
if (tokens.empty())
continue;
if ("*" == tokens.at(0))
- std::copy(++(tokens.begin()), tokens.end(),
+ std::copy(next(tokens.begin()), tokens.end(),
create_inserter<KeywordName>(std::back_inserter(_default_keywords)));
else
{
PackageDepAtom::ConstPointer a(new PackageDepAtom(tokens.at(0)));
- for (std::vector<std::string>::const_iterator t(++(tokens.begin())), t_end(tokens.end()) ;
+ for (std::vector<std::string>::const_iterator t(next(tokens.begin())), t_end(tokens.end()) ;
t != t_end ; ++t)
_keywords[a->package()].push_back(std::make_pair(a, *t));
}
@@ -227,7 +228,7 @@ DefaultConfig::DefaultConfig()
continue;
if ("*" == tokens.at(0))
- for (std::vector<std::string>::const_iterator t(++(tokens.begin())), t_end(tokens.end()) ;
+ for (std::vector<std::string>::const_iterator t(next(tokens.begin())), t_end(tokens.end()) ;
t != t_end ; ++t)
{
if ('-' == t->at(0))
diff --git a/paludis/files.m4 b/paludis/files.m4
index 361e2a6..02e25e9 100644
--- a/paludis/files.m4
+++ b/paludis/files.m4
@@ -57,6 +57,7 @@ add(`instantiation_policy', `hh', `cc', `test')
add(`internal_error', `hh', `cc')
add(`is_const', `hh', `cc', `test')
add(`is_file_with_extension', `hh', `cc', `test', `testscript')
+add(`iterator_utilities', `hh', `cc')
add(`join', `hh', `cc', `test')
add(`key_value_config_file', `hh', `cc', `test')
add(`keyword_name', `hh', `cc')
diff --git a/paludis/filter_insert_iterator_TEST.cc b/paludis/filter_insert_iterator_TEST.cc
index 8a17368..9ef50f3 100644
--- a/paludis/filter_insert_iterator_TEST.cc
+++ b/paludis/filter_insert_iterator_TEST.cc
@@ -4,6 +4,7 @@
#include <test/test_framework.hh>
#include <test/test_runner.hh>
#include <set>
+#include <algorithm>
using namespace test;
using namespace paludis;
diff --git a/paludis/iterator_utilities.cc b/paludis/iterator_utilities.cc
new file mode 100644
index 0000000..72377a5
--- /dev/null
+++ b/paludis/iterator_utilities.cc
@@ -0,0 +1,4 @@
+/* vim: set sw=4 sts=4 et foldmethod=syntax : */
+
+#include "iterator_utilities.hh"
+
diff --git a/paludis/iterator_utilities.hh b/paludis/iterator_utilities.hh
new file mode 100644
index 0000000..a8caae0
--- /dev/null
+++ b/paludis/iterator_utilities.hh
@@ -0,0 +1,41 @@
+/* vim: set sw=4 sts=4 et foldmethod=syntax : */
+
+/*
+ * Copyright (c) 2006 Ciaran McCreesh <ciaranm@gentoo.org>
+ *
+ * This file is part of the Paludis package manager. Paludis is free software;
+ * you can redistribute it and/or modify it under the terms of the GNU General
+ * Public License as published by the Free Software Foundation; either version
+ * 2 of the License, or (at your option) any later version.
+ *
+ * Paludis is distributed in the hope that it will be useful, but WITHOUT ANY
+ * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+ * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
+ * details.
+ *
+ * You should have received a copy of the GNU General Public License along with
+ * this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+ * Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+#ifndef PALUDIS_GUARD_PALUDIS_ITERATOR_UTILITIES_HH
+#define PALUDIS_GUARD_PALUDIS_ITERATOR_UTILITIES_HH 1
+
+namespace paludis
+{
+ template <typename T_>
+ T_ next(const T_ & i)
+ {
+ T_ result(i);
+ return ++result;
+ }
+
+ template <typename T_>
+ T_ previous(const T_ & i)
+ {
+ T_ result(i);
+ return --result;
+ }
+}
+
+#endif