Fixes for icc: define and use next() rather than ++ to advance pointers, add in a few new includes.
This commit is contained in:
parent
523561e790
commit
4f672a6d76
@ -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))
|
||||
|
@ -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')
|
||||
|
@ -4,6 +4,7 @@
|
||||
#include <test/test_framework.hh>
|
||||
#include <test/test_runner.hh>
|
||||
#include <set>
|
||||
#include <algorithm>
|
||||
|
||||
using namespace test;
|
||||
using namespace paludis;
|
||||
|
4
paludis/iterator_utilities.cc
Normal file
4
paludis/iterator_utilities.cc
Normal file
@ -0,0 +1,4 @@
|
||||
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
|
||||
|
||||
#include "iterator_utilities.hh"
|
||||
|
41
paludis/iterator_utilities.hh
Normal file
41
paludis/iterator_utilities.hh
Normal file
@ -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
|
Loading…
Reference in New Issue
Block a user