aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2007-11-02 07:39:03 +0000
committerAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2007-11-02 07:39:03 +0000
commitd832a1dd9e9718619bfb7bb7d0e3b48e26e65a33 (patch)
tree181f346e514cd8ff33c732f2b33ce234f1061cec
parentfef0280d7576927a74b8e7d2a0a96e700348f8b3 (diff)
downloadpaludis-d832a1dd9e9718619bfb7bb7d0e3b48e26e65a33.tar.gz
paludis-d832a1dd9e9718619bfb7bb7d0e3b48e26e65a33.tar.xz
Stop using libebt, libwrapiter. C++0x compliant iterators. Use static_assert, concepts where available.
-rw-r--r--configure.ac110
-rw-r--r--paludis/args/args_group.cc4
-rw-r--r--paludis/args/args_group.hh4
-rw-r--r--paludis/args/args_handler.cc26
-rw-r--r--paludis/args/args_handler.hh14
-rw-r--r--paludis/args/args_option.cc7
-rw-r--r--paludis/args/args_option.hh7
-rw-r--r--paludis/args/args_visitor.cc6
-rw-r--r--paludis/args/args_visitor.hh11
-rw-r--r--paludis/condition_tracker.cc2
-rw-r--r--paludis/contents.cc1
-rw-r--r--paludis/contents.hh3
-rw-r--r--paludis/dep_list.cc17
-rw-r--r--paludis/dep_list.hh6
-rw-r--r--paludis/dep_list_TEST.cc2
-rw-r--r--paludis/dep_list_TEST.hh2
-rw-r--r--paludis/dep_list_TEST_blockers.cc2
-rw-r--r--paludis/dep_list_exceptions.cc3
-rw-r--r--paludis/dep_spec.cc15
-rw-r--r--paludis/dep_spec.hh7
-rw-r--r--paludis/dep_spec_TEST.cc5
-rw-r--r--paludis/dep_spec_flattener.cc1
-rw-r--r--paludis/dep_spec_flattener.hh6
-rw-r--r--paludis/dep_tag.cc3
-rw-r--r--paludis/environment.cc4
-rw-r--r--paludis/environment_implementation.cc2
-rw-r--r--paludis/environments/no_config/no_config_environment.cc5
-rw-r--r--paludis/environments/no_config/no_config_environment.hh1
-rw-r--r--paludis/environments/paludis/keywords_conf.cc4
-rw-r--r--paludis/environments/paludis/licenses_conf.cc3
-rw-r--r--paludis/environments/paludis/mirrors_conf.cc9
-rw-r--r--paludis/environments/paludis/package_mask_conf.cc3
-rw-r--r--paludis/environments/paludis/paludis_config.cc70
-rw-r--r--paludis/environments/paludis/paludis_config.hh3
-rw-r--r--paludis/environments/paludis/paludis_environment.cc13
-rw-r--r--paludis/environments/paludis/paludis_environment_TEST.cc3
-rw-r--r--paludis/environments/paludis/use_conf.cc5
-rw-r--r--paludis/environments/portage/portage_environment.cc15
-rw-r--r--paludis/environments/portage/portage_environment_TEST.cc3
-rw-r--r--paludis/environments/test/test_environment.cc3
-rw-r--r--paludis/find_unused_packages_task.cc3
-rw-r--r--paludis/formatter.hh1
-rw-r--r--paludis/fuzzy_finder.cc6
-rw-r--r--paludis/fuzzy_finder.hh6
-rw-r--r--paludis/hook.cc5
-rw-r--r--paludis/hook.hh4
-rw-r--r--paludis/install_task.cc7
-rw-r--r--paludis/install_task.hh4
-rw-r--r--paludis/match_package.cc1
-rw-r--r--paludis/merger_TEST.cc1
-rw-r--r--paludis/name.cc27
-rw-r--r--paludis/package_database.cc28
-rw-r--r--paludis/package_database.hh7
-rw-r--r--paludis/package_database_TEST.cc6
-rw-r--r--paludis/package_id.cc14
-rw-r--r--paludis/package_id.hh7
-rw-r--r--paludis/paludis.hh.m41
-rw-r--r--paludis/query.cc2
-rw-r--r--paludis/query_visitor.cc2
-rw-r--r--paludis/range_rewriter.cc2
-rw-r--r--paludis/report_task.cc2
-rw-r--r--paludis/repositories/e/aa_visitor.cc2
-rw-r--r--paludis/repositories/e/aa_visitor.hh3
-rw-r--r--paludis/repositories/e/aa_visitor_TEST.cc1
-rw-r--r--paludis/repositories/e/dep_lexer.cc11
-rw-r--r--paludis/repositories/e/dep_lexer.hh5
-rw-r--r--paludis/repositories/e/dep_lexer_TEST.cc2
-rw-r--r--paludis/repositories/e/dep_parser.cc3
-rw-r--r--paludis/repositories/e/dep_parser_TEST.cc1
-rw-r--r--paludis/repositories/e/dep_spec_pretty_printer.cc1
-rw-r--r--paludis/repositories/e/dep_spec_pretty_printer_TEST.cc1
-rw-r--r--paludis/repositories/e/e_key.cc7
-rw-r--r--paludis/repositories/e/e_key.hh2
-rw-r--r--paludis/repositories/e/e_mask.cc6
-rw-r--r--paludis/repositories/e/e_mask.hh6
-rw-r--r--paludis/repositories/e/e_repository.cc11
-rw-r--r--paludis/repositories/e/e_repository_TEST.cc2
-rw-r--r--paludis/repositories/e/e_repository_mask_file.cc8
-rw-r--r--paludis/repositories/e/e_repository_mask_file.hh4
-rw-r--r--paludis/repositories/e/e_repository_news.cc6
-rw-r--r--paludis/repositories/e/e_repository_news.hh16
-rw-r--r--paludis/repositories/e/e_repository_profile.cc13
-rw-r--r--paludis/repositories/e/e_repository_profile.hh6
-rw-r--r--paludis/repositories/e/e_repository_profile_file.cc25
-rw-r--r--paludis/repositories/e/e_repository_profile_file.hh4
-rw-r--r--paludis/repositories/e/e_repository_sets.cc11
-rw-r--r--paludis/repositories/e/e_repository_sets_TEST.cc2
-rw-r--r--paludis/repositories/e/eapi.cc3
-rw-r--r--paludis/repositories/e/eapi_phase.cc9
-rw-r--r--paludis/repositories/e/eapi_phase.hh6
-rw-r--r--paludis/repositories/e/ebin.cc3
-rw-r--r--paludis/repositories/e/ebin_entries.cc2
-rw-r--r--paludis/repositories/e/ebuild.cc5
-rw-r--r--paludis/repositories/e/ebuild_entries.cc4
-rw-r--r--paludis/repositories/e/ebuild_flat_metadata_cache.cc1
-rw-r--r--paludis/repositories/e/ebuild_id.cc2
-rw-r--r--paludis/repositories/e/eclass_mtimes.cc3
-rw-r--r--paludis/repositories/e/exheres_layout.cc12
-rw-r--r--paludis/repositories/e/fetch_visitor_TEST.cc1
-rw-r--r--paludis/repositories/e/glsa.cc9
-rw-r--r--paludis/repositories/e/glsa.hh8
-rw-r--r--paludis/repositories/e/make_ebin_repository.cc5
-rw-r--r--paludis/repositories/e/make_ebuild_repository.cc5
-rw-r--r--paludis/repositories/e/manifest2_reader.cc13
-rw-r--r--paludis/repositories/e/manifest2_reader.hh3
-rw-r--r--paludis/repositories/e/registration.cc3
-rw-r--r--paludis/repositories/e/source_uri_finder.hh5
-rw-r--r--paludis/repositories/e/source_uri_finder_TEST.cc1
-rw-r--r--paludis/repositories/e/traditional_layout.cc12
-rw-r--r--paludis/repositories/e/use_desc.cc3
-rw-r--r--paludis/repositories/e/vdb_merger.cc3
-rw-r--r--paludis/repositories/e/vdb_repository.cc9
-rw-r--r--paludis/repositories/e/vdb_repository_TEST.cc2
-rw-r--r--paludis/repositories/e/vdb_unmerger.cc4
-rw-r--r--paludis/repositories/fake/fake_installed_repository.cc2
-rw-r--r--paludis/repositories/fake/fake_package_id.cc7
-rw-r--r--paludis/repositories/fake/fake_package_id.hh2
-rw-r--r--paludis/repositories/fake/fake_repository.cc3
-rw-r--r--paludis/repositories/fake/fake_repository_base.cc9
-rw-r--r--paludis/repositories/virtuals/installed_virtuals_repository.cc7
-rw-r--r--paludis/repositories/virtuals/package_id.cc2
-rw-r--r--paludis/repositories/virtuals/virtuals_repository.cc7
-rw-r--r--paludis/repositories/virtuals/virtuals_repository_TEST.cc4
-rw-r--r--paludis/repository.cc8
-rw-r--r--paludis/repository.hh8
-rw-r--r--paludis/repository_info.cc8
-rw-r--r--paludis/repository_info.hh5
-rw-r--r--paludis/repository_name_cache.cc4
-rw-r--r--paludis/repository_name_cache_TEST.cc3
-rw-r--r--paludis/set_file.cc2
-rw-r--r--paludis/set_file_TEST.cc1
-rw-r--r--paludis/show_suggest_visitor.cc2
-rw-r--r--paludis/stage_builder_task.cc5
-rw-r--r--paludis/stage_builder_task.hh5
-rw-r--r--paludis/stringify_formatter-impl.hh61
-rw-r--r--paludis/sync_task.cc4
-rw-r--r--paludis/sync_task.hh4
-rw-r--r--paludis/syncer.cc3
-rw-r--r--paludis/uninstall_list.cc6
-rw-r--r--paludis/uninstall_list.hh5
-rw-r--r--paludis/uninstall_list_TEST.cc2
-rw-r--r--paludis/uninstall_task.cc6
-rw-r--r--paludis/uninstall_task.hh4
-rw-r--r--paludis/util/config_file.cc8
-rw-r--r--paludis/util/config_file.hh11
-rw-r--r--paludis/util/config_file_TEST.cc3
-rw-r--r--paludis/util/destringify_TEST.cc8
-rw-r--r--paludis/util/dir_iterator.cc2
-rw-r--r--paludis/util/dir_iterator.hh27
-rw-r--r--paludis/util/exception.cc89
-rw-r--r--paludis/util/exception.hh6
-rw-r--r--paludis/util/fast_unique_copy.hh4
-rw-r--r--paludis/util/files.m47
-rw-r--r--paludis/util/fs_entry.cc7
-rw-r--r--paludis/util/graph-impl.hh4
-rw-r--r--paludis/util/iterator.hh573
-rw-r--r--paludis/util/iterator_TEST.cc439
-rw-r--r--paludis/util/map-impl.hh4
-rw-r--r--paludis/util/map.cc4
-rw-r--r--paludis/util/map.hh9
-rw-r--r--paludis/util/pstream.cc2
-rw-r--r--paludis/util/sequence-impl.hh4
-rw-r--r--paludis/util/sequence.hh12
-rw-r--r--paludis/util/set-impl.hh2
-rw-r--r--paludis/util/set.hh9
-rw-r--r--paludis/util/system.cc5
-rw-r--r--paludis/util/system.hh4
-rw-r--r--paludis/util/tr1_type_traits.hh2
-rw-r--r--paludis/util/virtual_constructor-impl.hh5
-rw-r--r--paludis/util/visitor-impl.hh4
-rw-r--r--paludis/util/visitor.hh6
-rw-r--r--paludis/util/visitor_TEST.cc1
-rw-r--r--paludis/version_requirements.cc6
-rw-r--r--paludis/version_spec.cc2
-rw-r--r--src/clients/adjutrix/display_default_system_resolution.cc1
-rw-r--r--src/clients/adjutrix/downgrade_check.cc2
-rw-r--r--src/clients/adjutrix/find_dropped_keywords.cc3
-rw-r--r--src/clients/adjutrix/find_insecure_packages.cc1
-rw-r--r--src/clients/adjutrix/find_reverse_deps.cc2
-rw-r--r--src/clients/adjutrix/find_stable_candidates.cc3
-rw-r--r--src/clients/adjutrix/find_unused_packages.cc2
-rw-r--r--src/clients/adjutrix/keywords_graph.cc6
-rw-r--r--src/clients/adjutrix/what_needs_keywording.cc1
-rw-r--r--src/clients/paludis/applets.cc2
-rw-r--r--src/clients/paludis/info.cc8
-rw-r--r--src/clients/paludis/install.cc3
-rw-r--r--src/clients/paludis/list.cc1
-rw-r--r--src/clients/paludis/paludis.cc3
-rw-r--r--src/clients/reconcilio/broken_linkage_finder/Makefile.am1
-rw-r--r--src/clients/reconcilio/broken_linkage_finder/broken_linkage_finder.cc8
-rw-r--r--src/clients/reconcilio/broken_linkage_finder/broken_linkage_finder.hh17
-rw-r--r--src/clients/reconcilio/broken_linkage_finder/configuration.cc9
-rw-r--r--src/clients/reconcilio/broken_linkage_finder/configuration.hh5
-rw-r--r--src/clients/reconcilio/broken_linkage_finder/configuration_TEST.cc3
-rw-r--r--src/clients/reconcilio/broken_linkage_finder/elf_linkage_checker.cc2
-rw-r--r--src/clients/reconcilio/fix_linkage.cc2
-rw-r--r--src/clients/reconcilio/littlelf/elf.cc8
-rw-r--r--src/clients/reconcilio/littlelf/elf.hh6
-rw-r--r--src/clients/reconcilio/littlelf/elf_dynamic_section.cc8
-rw-r--r--src/clients/reconcilio/littlelf/elf_dynamic_section.hh3
-rw-r--r--src/clients/reconcilio/littlelf/elf_relocation_section.cc14
-rw-r--r--src/clients/reconcilio/littlelf/elf_relocation_section.hh3
-rw-r--r--src/clients/reconcilio/littlelf/elf_symbol_section.cc7
-rw-r--r--src/clients/reconcilio/littlelf/elf_symbol_section.hh5
-rw-r--r--src/clients/reconcilio/util/wildcard_expander.cc2
-rw-r--r--src/clients/reconcilio/util/wildcard_expander.hh2
-rw-r--r--src/output/console_install_task.cc5
-rw-r--r--src/output/console_install_task.hh1
-rw-r--r--src/output/console_query_task.cc2
-rw-r--r--src/output/mask_displayer.cc2
210 files changed, 759 insertions, 1693 deletions
diff --git a/configure.ac b/configure.ac
index e054796..4b27849 100644
--- a/configure.ac
+++ b/configure.ac
@@ -171,6 +171,64 @@ using n::r_x;
AC_MSG_ERROR([Your compiler is b0rked (GCC bug 31899?)])])
dnl }}}
+dnl {{{ check for static_assert
+AC_MSG_CHECKING([for compiler support for static_assert])
+AC_COMPILE_IFELSE([
+int main(int, char **)
+{
+ static_assert(true, "works");
+}
+],
+ [AC_MSG_RESULT([yes])
+ AC_MSG_CHECKING([whether static_assert works])
+ AC_COMPILE_IFELSE([
+int main(int, char **)
+{
+ static_assert(false, "works");
+}
+],
+ [AC_MSG_RESULT([no])],
+ [AC_MSG_RESULT([yes])
+ PALUDIS_CXXFLAGS="${PALUDIS_CXXFLAGS} -DPALUDIS_HAVE_STATIC_ASSERT=1"
+ PALUDIS_PC_CFLAGS="${PALUDIS_PC_CFLAGS} -DPALUDIS_HAVE_STATIC_ASSERT=1"
+ ])],
+ [AC_MSG_RESULT([no])])
+dnl }}}
+
+dnl {{{ check for concept support
+AC_MSG_CHECKING([for compiler support for concepts])
+AC_COMPILE_IFELSE([
+auto concept Monkeyable<typename T_>
+{
+ void T_::monkey () const;
+};
+
+template <Monkeyable Monkey_>
+void monkey_lots(const Monkey_ & m)
+{
+ for (int x(0) ; x < 10 ; ++x)
+ m.monkey();
+}
+
+struct Bobo
+{
+ void monkey() const
+ {
+ }
+};
+
+int main(int, char **)
+{
+ monkey_lots(Bobo());
+}
+],
+ [AC_MSG_RESULT([yes])
+ PALUDIS_CXXFLAGS="${PALUDIS_CXXFLAGS} -DPALUDIS_HAVE_CONCEPTS=1"
+ PALUDIS_PC_CFLAGS="${PALUDIS_PC_CFLAGS} -DPALUDIS_HAVE_CONCEPTS=1"
+ ],
+ [AC_MSG_RESULT([no])])
+dnl }}}
+
dnl {{{ check for hashes
AC_MSG_CHECKING([for hashed associative containers])
AC_COMPILE_IFELSE([
@@ -351,53 +409,6 @@ need_syck_check=
need_gem_check=
need_gtkmm_check=
-dnl {{{ we need libebt.
-dnl don't use AC_CHECK_HEADER, it does silly things
-AC_MSG_CHECKING([for libebt])
-AC_COMPILE_IFELSE([
-#include <libebt/libebt.hh>
-#include <string>
-struct Tag { };
-int main(int, char **)
-{
- libebt::BacktraceContext<Tag> context("blah");
-}
-],
- [AC_MSG_RESULT([yes])],
- [AC_MSG_RESULT([no])
- AC_MSG_ERROR([libebt (http://libebt.berlios.de/) is required])])
-dnl }}}
-
-dnl {{{ we need libwrapiter.
-dnl don't use AC_CHECK_HEADER, it does silly things
-AC_MSG_CHECKING([for libwrapiter])
-AC_COMPILE_IFELSE([
-#include <libwrapiter/libwrapiter.hh>
-#include <string>
-struct C {
- typedef libwrapiter::ForwardIterator<C, int> Iterator;
- Iterator begin();
- Iterator end();
-};
-int main(int, char **)
-{
-}
-],
- [AC_MSG_RESULT([yes])],
- [AC_MSG_RESULT([no])
- AC_MSG_ERROR([libwrapiter (http://libwrapiter.berlios.de/) is required])])
-AC_MSG_CHECKING([libwrapiter version])
-AC_COMPILE_IFELSE([
-#include <libwrapiter/libwrapiter.hh>
-#if LIBWRAPITER_VERSION < 10200
-# error libwrapiter 1.2.0 or later required
-#endif
-],
- [AC_MSG_RESULT([yes])],
- [AC_MSG_RESULT([no])
- AC_MSG_ERROR([libwrapiter version must be at least 1.2.0])])
-dnl }}}
-
dnl {{{ we can use abi::__cxa_demangle
AC_MSG_CHECKING([for abi::__cxa_demangle])
AC_COMPILE_IFELSE([
@@ -596,6 +607,8 @@ elif test "x${ac_cv_cxx_compiler_gnu}" = "xyes" ; then
CHECK_CXXFLAG([-Wlogical-op])
CHECK_CXXFLAG([-Wvla])
CHECK_CXXFLAG([-Wwrite-strings])
+ CHECK_CXXFLAG([-Wsignature-shadow])
+ CHECK_CXXFLAG([-Wfloat-equal])
if test "x$cxxflag_success" = "xyes" ; then
PALUDIS_CXXFLAGS_NO_WWRITE_STRINGS=-Wno-write-strings
fi
@@ -686,8 +699,7 @@ AM_CONDITIONAL([HAVE_DOXYGEN_TAGS], test "x$HAVE_DOXYGEN_TAGS" = "xyes")
if test "x$HAVE_DOXYGEN_TAGS" = xyes ; then
DOXYGEN_TAG_FILES="\
- \"libstdc++.tag = http://gcc.gnu.org/onlinedocs/libstdc++/latest-doxygen\" \
- \"libwrapiter.tag = http://libwrapiter.pioto.org/\""
+ \"libstdc++.tag = http://gcc.gnu.org/onlinedocs/libstdc++/latest-doxygen\""
else
DOXYGEN_TAG_FILES=""
fi
diff --git a/paludis/args/args_group.cc b/paludis/args/args_group.cc
index 07c5459..096ac06 100644
--- a/paludis/args/args_group.cc
+++ b/paludis/args/args_group.cc
@@ -19,10 +19,14 @@
#include "args.hh"
#include <paludis/util/private_implementation_pattern-impl.hh>
+#include <paludis/util/wrapped_forward_iterator-impl.hh>
#include <list>
+using namespace paludis;
using namespace paludis::args;
+template class WrappedForwardIterator<ArgsGroup::ConstIteratorTag, ArgsOption * const>;
+
namespace paludis
{
/**
diff --git a/paludis/args/args_group.hh b/paludis/args/args_group.hh
index c030c0f..705256d 100644
--- a/paludis/args/args_group.hh
+++ b/paludis/args/args_group.hh
@@ -25,8 +25,6 @@
#include <paludis/util/private_implementation_pattern.hh>
#include <string>
-#include <libwrapiter/libwrapiter_forward_iterator-fwd.hh>
-
/** \file
* Declarations for ArgsGroup.
*
@@ -84,7 +82,7 @@ namespace paludis
///\name Iterate over our ArgsOptions.
///\{
- typedef libwrapiter::ForwardIterator<ArgsGroup, ArgsOption * const> ConstIterator;
+ typedef WrappedForwardIterator<enum ConstIteratorTag { }, ArgsOption * const> ConstIterator;
ConstIterator begin() const;
ConstIterator end() const;
diff --git a/paludis/args/args_handler.cc b/paludis/args/args_handler.cc
index 9ee56aa..9bbc018 100644
--- a/paludis/args/args_handler.cc
+++ b/paludis/args/args_handler.cc
@@ -21,16 +21,26 @@
#include "args_dumper.hh"
#include <paludis/util/system.hh>
#include <paludis/util/join.hh>
-#include <paludis/util/iterator.hh>
#include <paludis/util/private_implementation_pattern-impl.hh>
#include <paludis/util/visitor-impl.hh>
+#include <paludis/util/wrapped_forward_iterator-impl.hh>
#include <algorithm>
#include <sstream>
#include <list>
#include <map>
+using namespace paludis;
using namespace paludis::args;
+template class WrappedForwardIterator<ArgsHandler::ParametersConstIteratorTag, const std::string>;
+template class WrappedForwardIterator<ArgsHandler::UsageLineConstIteratorTag, const std::string>;
+template class WrappedForwardIterator<ArgsHandler::EnvironmentLineConstIteratorTag,
+ const std::pair<std::string, std::string> >;
+template class WrappedForwardIterator<ArgsHandler::ExamplesConstIteratorTag,
+ const std::pair<std::string, std::string> >;
+template class WrappedForwardIterator<ArgsHandler::ArgsGroupsConstIteratorTag, ArgsGroup * const>;
+template class WrappedForwardIterator<ArgsHandler::NotesIteratorTag, const std::string>;
+
namespace paludis
{
/**
@@ -125,8 +135,7 @@ ArgsHandler::run(const int argc, const char * const * const argv,
args.insert(args.end(), &argv[1], &argv[argc]);
- libwrapiter::ForwardIterator<ArgsVisitor, std::string> argit(args.begin()), arge(args.end());
-
+ ArgsVisitor::ArgsIterator argit(args.begin()), arge(args.end());
ArgsVisitor visitor(&argit, arge, env_prefix);
for ( ; argit != arge; ++argit )
@@ -165,8 +174,7 @@ ArgsHandler::run(const int argc, const char * const * const argv,
}
}
- _imp->parameters.insert(_imp->parameters.end(),
- argit, libwrapiter::ForwardIterator<ArgsVisitor, std::string>(args.end()));
+ _imp->parameters.insert(_imp->parameters.end(), argit, ArgsVisitor::ArgsIterator(args.end()));
if (! env_prefix.empty())
setenv((env_prefix + "_PARAMS").c_str(), join(_imp->parameters.begin(),
@@ -254,16 +262,16 @@ ArgsHandler::end_environment_lines() const
return EnvironmentLineConstIterator(_imp->environment_lines.end());
}
-ArgsHandler::EnvironmentLineConstIterator
+ArgsHandler::ExamplesConstIterator
ArgsHandler::begin_examples() const
{
- return EnvironmentLineConstIterator(_imp->example_lines.begin());
+ return ExamplesConstIterator(_imp->example_lines.begin());
}
-ArgsHandler::EnvironmentLineConstIterator
+ArgsHandler::ExamplesConstIterator
ArgsHandler::end_examples() const
{
- return EnvironmentLineConstIterator(_imp->example_lines.end());
+ return ExamplesConstIterator(_imp->example_lines.end());
}
ArgsHandler::NotesIterator
diff --git a/paludis/args/args_handler.hh b/paludis/args/args_handler.hh
index 058ee2a..2abb42c 100644
--- a/paludis/args/args_handler.hh
+++ b/paludis/args/args_handler.hh
@@ -27,8 +27,6 @@
#include <iosfwd>
#include <string>
-#include <libwrapiter/libwrapiter_forward_iterator-fwd.hh>
-
/** \file
* Declarations for ArgsHandler.
*
@@ -117,7 +115,7 @@ namespace paludis
///\name Iterate over our parameters (non - and -- switches and their values)
///\{
- typedef libwrapiter::ForwardIterator<ArgsHandler, const std::string> ParametersConstIterator;
+ typedef WrappedForwardIterator<enum ParametersConstIteratorTag { }, const std::string> ParametersConstIterator;
ParametersConstIterator begin_parameters() const;
@@ -169,7 +167,7 @@ namespace paludis
///\name Iterate over our usage lines (for documentation)
///\{
- typedef libwrapiter::ForwardIterator<ArgsHandler, const std::string> UsageLineConstIterator;
+ typedef WrappedForwardIterator<enum UsageLineConstIteratorTag { }, const std::string> UsageLineConstIterator;
UsageLineConstIterator begin_usage_lines() const;
@@ -180,7 +178,7 @@ namespace paludis
///\name Iterate over our environment lines (for documentation)
///\{
- typedef libwrapiter::ForwardIterator<ArgsHandler,
+ typedef WrappedForwardIterator<enum EnvironmentLineConstIteratorTag { },
const std::pair<std::string, std::string> > EnvironmentLineConstIterator;
EnvironmentLineConstIterator begin_environment_lines() const;
@@ -192,7 +190,7 @@ namespace paludis
///\name Iterate over our examples (for documentation)
///\{
- typedef libwrapiter::ForwardIterator<ArgsHandler,
+ typedef WrappedForwardIterator<enum ExamplesConstIteratorTag { },
const std::pair<std::string, std::string> > ExamplesConstIterator;
ExamplesConstIterator begin_examples() const;
@@ -204,7 +202,7 @@ namespace paludis
///\name Iterate over our groups
///\{
- typedef libwrapiter::ForwardIterator<ArgsHandler, ArgsGroup * const> ArgsGroupsConstIterator;
+ typedef WrappedForwardIterator<enum ArgsGroupsConstIteratorTag { }, ArgsGroup * const> ArgsGroupsConstIterator;
ArgsGroupsConstIterator begin_args_groups() const;
@@ -215,7 +213,7 @@ namespace paludis
///\name Iterate over our notes
///\{
- typedef libwrapiter::ForwardIterator<ArgsHandler, const std::string > NotesIterator;
+ typedef WrappedForwardIterator<enum NotesIteratorTag { }, const std::string > NotesIterator;
NotesIterator begin_notes() const;
NotesIterator end_notes() const;
diff --git a/paludis/args/args_option.cc b/paludis/args/args_option.cc
index d79b9f7..d9f1f13 100644
--- a/paludis/args/args_option.cc
+++ b/paludis/args/args_option.cc
@@ -20,6 +20,7 @@
#include "args.hh"
#include "args_error.hh"
#include <paludis/util/private_implementation_pattern-impl.hh>
+#include <paludis/util/wrapped_forward_iterator-impl.hh>
#include <set>
#include <vector>
#include <algorithm>
@@ -27,6 +28,12 @@
using namespace paludis;
using namespace paludis::args;
+template class WrappedForwardIterator<StringSetArg::ConstIteratorTag, const std::string>;
+template class WrappedForwardIterator<StringSetArg::AllowedArgConstIteratorTag,
+ const std::pair<std::string, std::string> >;
+template class WrappedForwardIterator<EnumArg::AllowedArgConstIteratorTag,
+ const std::pair<std::string, std::string> >;
+
namespace
{
struct ArgIs
diff --git a/paludis/args/args_option.hh b/paludis/args/args_option.hh
index c170ad3..d1700fb 100644
--- a/paludis/args/args_option.hh
+++ b/paludis/args/args_option.hh
@@ -23,6 +23,7 @@
#include <paludis/args/args_visitor.hh>
#include <paludis/util/private_implementation_pattern.hh>
+#include <paludis/util/wrapped_forward_iterator-fwd.hh>
/** \file
* Declarations for ArgsOption.
@@ -260,7 +261,7 @@ namespace paludis
///\name Iterate over our args.
///\{
- typedef libwrapiter::ForwardIterator<StringArg, const std::string> ConstIterator;
+ typedef WrappedForwardIterator<enum ConstIteratorTag { }, const std::string> ConstIterator;
ConstIterator begin_args() const;
@@ -276,7 +277,7 @@ namespace paludis
///\name Iterate over our allowed arguments and associated descriptions
///\{
- typedef libwrapiter::ForwardIterator<StringSetArg,
+ typedef WrappedForwardIterator<enum AllowedArgConstIteratorTag { },
const std::pair<std::string, std::string> > AllowedArgConstIterator;
AllowedArgConstIterator begin_allowed_args() const;
@@ -438,7 +439,7 @@ namespace paludis
///\name Iterate over our allowed arguments and associated descriptions
///\{
- typedef libwrapiter::ForwardIterator<EnumArg,
+ typedef WrappedForwardIterator<enum AllowedArgConstIteratorTag { },
const std::pair<std::string, std::string> > AllowedArgConstIterator;
AllowedArgConstIterator begin_allowed_args() const;
diff --git a/paludis/args/args_visitor.cc b/paludis/args/args_visitor.cc
index 9df2b15..4241000 100644
--- a/paludis/args/args_visitor.cc
+++ b/paludis/args/args_visitor.cc
@@ -24,6 +24,7 @@
#include <paludis/util/destringify.hh>
#include <paludis/util/system.hh>
#include <paludis/util/join.hh>
+#include <paludis/util/wrapped_forward_iterator-impl.hh>
#include <algorithm>
#include <sstream>
@@ -56,8 +57,9 @@ template class Visits<const StringSetArg>;
template class Visits<const AliasArg>;
template class Visits<const SwitchArg>;
-ArgsVisitor::ArgsVisitor(libwrapiter::ForwardIterator<ArgsVisitor, std::string> * ai,
- libwrapiter::ForwardIterator<ArgsVisitor, std::string> ae,
+template class WrappedForwardIterator<ArgsVisitor::ArgsIteratorTag, std::string>;
+
+ArgsVisitor::ArgsVisitor(ArgsIterator * ai, ArgsIterator ae,
const std::string & env_prefix) :
_args_index(ai),
_args_end(ae),
diff --git a/paludis/args/args_visitor.hh b/paludis/args/args_visitor.hh
index 855cea1..f7a5d49 100644
--- a/paludis/args/args_visitor.hh
+++ b/paludis/args/args_visitor.hh
@@ -22,11 +22,10 @@
#define PALUDIS_GUARD_ARGS_ARGS_VISITOR_HH 1
#include <paludis/util/visitor.hh>
+#include <paludis/util/wrapped_forward_iterator.hh>
#include <paludis/util/attributes.hh>
#include <string>
-#include <libwrapiter/libwrapiter_forward_iterator.hh>
-
/** \file
* Declarations for ArgsVisitor.
*
@@ -75,8 +74,11 @@ namespace paludis
class PALUDIS_VISIBLE ArgsVisitor :
public Visitor<ArgsVisitorTypes>
{
+ public:
+ typedef WrappedForwardIterator<enum ArgsIteratorTag { }, std::string> ArgsIterator;
+
private:
- libwrapiter::ForwardIterator<ArgsVisitor, std::string> * _args_index, _args_end;
+ ArgsIterator * _args_index, _args_end;
std::string _env_prefix;
const std::string & get_param(const ArgsOption &);
@@ -87,8 +89,7 @@ namespace paludis
/**
* Constructor
*/
- ArgsVisitor(libwrapiter::ForwardIterator<ArgsVisitor, std::string> *,
- libwrapiter::ForwardIterator<ArgsVisitor, std::string>,
+ ArgsVisitor(ArgsIterator *, ArgsIterator,
const std::string & env_prefix = "");
/// Visit a StringArg.
diff --git a/paludis/condition_tracker.cc b/paludis/condition_tracker.cc
index a0314d2..a07f3f3 100644
--- a/paludis/condition_tracker.cc
+++ b/paludis/condition_tracker.cc
@@ -22,8 +22,6 @@
#include <paludis/util/visitor-impl.hh>
#include <paludis/dep_spec.hh>
#include <paludis/dep_label.hh>
-#include <libwrapiter/libwrapiter_forward_iterator.hh>
-#include <libwrapiter/libwrapiter_output_iterator.hh>
using namespace paludis;
using namespace tr1::placeholders;
diff --git a/paludis/contents.cc b/paludis/contents.cc
index 020e407..16f12d0 100644
--- a/paludis/contents.cc
+++ b/paludis/contents.cc
@@ -20,7 +20,6 @@
#include "contents.hh"
#include <paludis/util/visitor-impl.hh>
#include <paludis/util/private_implementation_pattern-impl.hh>
-#include <libwrapiter/libwrapiter_forward_iterator.hh>
#include <list>
using namespace paludis;
diff --git a/paludis/contents.hh b/paludis/contents.hh
index 3317706..667dd98 100644
--- a/paludis/contents.hh
+++ b/paludis/contents.hh
@@ -28,7 +28,6 @@
#include <paludis/util/tr1_memory.hh>
#include <string>
-#include <libwrapiter/libwrapiter_forward_iterator-fwd.hh>
/** \file
* Declarations for the Contents classes.
@@ -240,7 +239,7 @@ namespace paludis
///\name Iterate over our entries
///\{
- typedef libwrapiter::ForwardIterator<Contents, const tr1::shared_ptr<const ContentsEntry> > ConstIterator;
+ typedef WrappedForwardIterator<enum ConstIteratorTag { }, const tr1::shared_ptr<const ContentsEntry> > ConstIterator;
ConstIterator begin() const
PALUDIS_ATTRIBUTE((warn_unused_result));
diff --git a/paludis/dep_list.cc b/paludis/dep_list.cc
index 9791aa6..3358e6e 100644
--- a/paludis/dep_list.cc
+++ b/paludis/dep_list.cc
@@ -36,21 +36,20 @@
#include <paludis/package_id.hh>
#include <paludis/version_requirements.hh>
-#include <paludis/util/iterator.hh>
#include <paludis/util/join.hh>
#include <paludis/util/log.hh>
#include <paludis/util/private_implementation_pattern-impl.hh>
#include <paludis/util/make_shared_ptr.hh>
+#include <paludis/util/iterator_funcs.hh>
#include <paludis/util/save.hh>
+#include <paludis/util/member_iterator.hh>
#include <paludis/util/set.hh>
#include <paludis/util/sequence.hh>
#include <paludis/util/stringify.hh>
#include <paludis/util/tokeniser.hh>
#include <paludis/util/tr1_functional.hh>
#include <paludis/util/visitor-impl.hh>
-
-#include <libwrapiter/libwrapiter_forward_iterator.hh>
-#include <libwrapiter/libwrapiter_output_iterator.hh>
+#include <paludis/util/wrapped_forward_iterator-impl.hh>
#include <algorithm>
#include <functional>
@@ -61,6 +60,8 @@
using namespace paludis;
template class Sequence<tr1::function<bool (const PackageID &, const Mask &)> >;
+template class WrappedForwardIterator<DepList::IteratorTag, DepListEntry>;
+template class WrappedForwardIterator<DepList::ConstIteratorTag, const DepListEntry>;
#include <paludis/dep_list-sr.cc>
@@ -1402,11 +1403,15 @@ DepList::prefer_installed_over_uninstalled(const PackageID & installed,
{
std::set<UseFlagName> use_common;
if (installed.iuse_key() && uninstalled.iuse_key())
+ {
+ std::set<IUseFlag> iuse_common;
std::set_intersection(
installed.iuse_key()->value()->begin(), installed.iuse_key()->value()->end(),
uninstalled.iuse_key()->value()->begin(), uninstalled.iuse_key()->value()->end(),
- transform_inserter(std::inserter(use_common, use_common.end()),
- paludis::tr1::mem_fn(&IUseFlag::flag)));
+ std::inserter(iuse_common, iuse_common.begin()));
+ std::transform(iuse_common.begin(), iuse_common.end(), std::inserter(use_common, use_common.begin()),
+ tr1::mem_fn(&IUseFlag::flag));
+ }
for (std::set<UseFlagName>::const_iterator f(use_common.begin()), f_end(use_common.end()) ;
f != f_end ; ++f)
diff --git a/paludis/dep_list.hh b/paludis/dep_list.hh
index dc6c490..35eae2e 100644
--- a/paludis/dep_list.hh
+++ b/paludis/dep_list.hh
@@ -36,8 +36,6 @@
#include <iosfwd>
-#include <libwrapiter/libwrapiter_forward_iterator-fwd.hh>
-
/** \file
* Declarations for DepList and related classes.
*
@@ -204,8 +202,8 @@ namespace paludis
///\name Iterate over our dependency list entries.
///\{
- typedef libwrapiter::ForwardIterator<DepList, DepListEntry> Iterator;
- typedef libwrapiter::ForwardIterator<DepList, const DepListEntry> ConstIterator;
+ typedef WrappedForwardIterator<enum IteratorTag { }, DepListEntry> Iterator;
+ typedef WrappedForwardIterator<enum ConstIteratorTag { }, const DepListEntry> ConstIterator;
Iterator begin();
Iterator end();
diff --git a/paludis/dep_list_TEST.cc b/paludis/dep_list_TEST.cc
index a054a89..71c8ec8 100644
--- a/paludis/dep_list_TEST.cc
+++ b/paludis/dep_list_TEST.cc
@@ -26,8 +26,6 @@
#include <paludis/repositories/fake/fake_package_id.hh>
#include <paludis/override_functions.hh>
#include <paludis/repositories/e/dep_spec_pretty_printer.hh>
-#include <libwrapiter/libwrapiter_forward_iterator.hh>
-#include <libwrapiter/libwrapiter_output_iterator.hh>
using namespace paludis;
using namespace test;
diff --git a/paludis/dep_list_TEST.hh b/paludis/dep_list_TEST.hh
index 6fe044d..2ff9073 100644
--- a/paludis/dep_list_TEST.hh
+++ b/paludis/dep_list_TEST.hh
@@ -27,10 +27,10 @@
#include <paludis/repositories/virtuals/virtuals_repository.hh>
#include <paludis/repositories/virtuals/installed_virtuals_repository.hh>
#include <paludis/util/fs_entry.hh>
+#include <paludis/util/wrapped_forward_iterator.hh>
#include <paludis/environments/test/test_environment.hh>
#include <test/test_framework.hh>
#include <test/test_runner.hh>
-#include <libwrapiter/libwrapiter_forward_iterator.hh>
#include <string>
#include <list>
#include <ostream>
diff --git a/paludis/dep_list_TEST_blockers.cc b/paludis/dep_list_TEST_blockers.cc
index f99acbd..96bae43 100644
--- a/paludis/dep_list_TEST_blockers.cc
+++ b/paludis/dep_list_TEST_blockers.cc
@@ -19,6 +19,8 @@
#include "dep_list_TEST.hh"
#include <paludis/repositories/fake/fake_package_id.hh>
+#include <paludis/util/iterator_funcs.hh>
+#include <paludis/util/wrapped_forward_iterator.hh>
using namespace paludis;
using namespace test;
diff --git a/paludis/dep_list_exceptions.cc b/paludis/dep_list_exceptions.cc
index 8309a46..085a365 100644
--- a/paludis/dep_list_exceptions.cc
+++ b/paludis/dep_list_exceptions.cc
@@ -19,8 +19,7 @@
#include "dep_list_exceptions.hh"
#include <paludis/util/set.hh>
-#include <libwrapiter/libwrapiter_forward_iterator.hh>
-#include <libwrapiter/libwrapiter_output_iterator.hh>
+#include <paludis/util/wrapped_forward_iterator.hh>
using namespace paludis;
diff --git a/paludis/dep_spec.cc b/paludis/dep_spec.cc
index 48f2001..552caed 100644
--- a/paludis/dep_spec.cc
+++ b/paludis/dep_spec.cc
@@ -24,13 +24,14 @@
#include <paludis/util/clone-impl.hh>
#include <paludis/util/log.hh>
#include <paludis/util/join.hh>
-#include <paludis/util/iterator.hh>
#include <paludis/util/private_implementation_pattern-impl.hh>
#include <paludis/util/stringify.hh>
#include <paludis/util/mutex.hh>
#include <paludis/util/sequence.hh>
-#include <libwrapiter/libwrapiter_forward_iterator.hh>
-#include <libwrapiter/libwrapiter_output_iterator.hh>
+#include <paludis/util/wrapped_forward_iterator-impl.hh>
+#include <paludis/util/wrapped_output_iterator.hh>
+#include <paludis/util/iterator_funcs.hh>
+#include <paludis/util/indirect_iterator-impl.hh>
#include <list>
#include <map>
@@ -1134,6 +1135,14 @@ LabelsDepSpec<T_>::add_label(const tr1::shared_ptr<const typename T_::BasicNode>
_imp->items.push_back(item);
}
+template class WrappedForwardIterator<UseRequirements::ConstIteratorTag, const std::pair<const UseFlagName, UseFlagState> >;
+
template class LabelsDepSpec<URILabelVisitorTypes>;
+template class WrappedForwardIterator<LabelsDepSpec<URILabelVisitorTypes>::ConstIteratorTag,
+ const tr1::shared_ptr<const URILabelVisitorTypes::BasicNode> >;
+
template class LabelsDepSpec<DependencyLabelVisitorTypes>;
+template class WrappedForwardIterator<LabelsDepSpec<DependencyLabelVisitorTypes>::ConstIteratorTag,
+ const tr1::shared_ptr<const DependencyLabelVisitorTypes::BasicNode> >;
+
diff --git a/paludis/dep_spec.hh b/paludis/dep_spec.hh
index 27506de..6c36097 100644
--- a/paludis/dep_spec.hh
+++ b/paludis/dep_spec.hh
@@ -25,6 +25,7 @@
#include <paludis/util/instantiation_policy.hh>
#include <paludis/util/private_implementation_pattern.hh>
#include <paludis/util/tr1_memory.hh>
+#include <paludis/util/wrapped_forward_iterator-fwd.hh>
#include <paludis/dep_label.hh>
#include <paludis/dep_spec-fwd.hh>
@@ -34,8 +35,6 @@
#include <paludis/version_requirements-fwd.hh>
#include <paludis/version_spec-fwd.hh>
-#include <libwrapiter/libwrapiter_forward_iterator-fwd.hh>
-
/** \file
* Declarations for dependency spec classes.
*
@@ -225,7 +224,7 @@ namespace paludis
///\name Iterate over our USE requirements
///\{
- typedef libwrapiter::ForwardIterator<UseRequirements,
+ typedef WrappedForwardIterator<enum ConstIteratorTag { },
const std::pair<const UseFlagName, UseFlagState> > ConstIterator;
ConstIterator begin() const;
@@ -588,7 +587,7 @@ namespace paludis
///\{
void add_label(const tr1::shared_ptr<const typename SpecTree_::BasicNode> &);
- typedef libwrapiter::ForwardIterator<LabelsDepSpec<SpecTree_>,
+ typedef WrappedForwardIterator<enum ConstIteratorTag { },
const tr1::shared_ptr<const typename SpecTree_::BasicNode> > ConstIterator;
ConstIterator begin() const PALUDIS_ATTRIBUTE((warn_unused_result));
ConstIterator end() const PALUDIS_ATTRIBUTE((warn_unused_result));
diff --git a/paludis/dep_spec_TEST.cc b/paludis/dep_spec_TEST.cc
index 37fa795..7355030 100644
--- a/paludis/dep_spec_TEST.cc
+++ b/paludis/dep_spec_TEST.cc
@@ -19,11 +19,10 @@
#include <paludis/dep_spec.hh>
#include <paludis/util/clone-impl.hh>
-#include <paludis/util/iterator.hh>
#include <paludis/util/sequence.hh>
+#include <paludis/util/wrapped_forward_iterator.hh>
+#include <paludis/util/iterator_funcs.hh>
#include <paludis/version_requirements.hh>
-#include <libwrapiter/libwrapiter_forward_iterator.hh>
-#include <libwrapiter/libwrapiter_output_iterator.hh>
#include <test/test_framework.hh>
#include <test/test_runner.hh>
diff --git a/paludis/dep_spec_flattener.cc b/paludis/dep_spec_flattener.cc
index 764c40f..1031c1e 100644
--- a/paludis/dep_spec_flattener.cc
+++ b/paludis/dep_spec_flattener.cc
@@ -25,7 +25,6 @@
#include <paludis/util/private_implementation_pattern-impl.hh>
#include <paludis/util/log.hh>
#include <paludis/util/stringify.hh>
-#include <libwrapiter/libwrapiter_forward_iterator.hh>
#include <list>
#include <algorithm>
#include <set>
diff --git a/paludis/dep_spec_flattener.hh b/paludis/dep_spec_flattener.hh
index 54148a7..212c499 100644
--- a/paludis/dep_spec_flattener.hh
+++ b/paludis/dep_spec_flattener.hh
@@ -29,10 +29,9 @@
#include <paludis/util/tr1_memory.hh>
#include <paludis/util/visitor.hh>
#include <paludis/util/no_type.hh>
+#include <paludis/util/wrapped_forward_iterator-fwd.hh>
#include <paludis/util/sr.hh>
-#include <libwrapiter/libwrapiter_forward_iterator-fwd.hh>
-
/** \file
* Declarations for DepSpecFlattener.
*
@@ -195,8 +194,7 @@ namespace paludis
///\name Iterate over our dep specs
///\{
- typedef libwrapiter::ForwardIterator<DepSpecFlattener<Heirarchy_, Item_>,
- const tr1::shared_ptr<const Item_> > ConstIterator;
+ typedef WrappedForwardIterator<enum ConstIteratorTag { }, const tr1::shared_ptr<const Item_> > ConstIterator;
ConstIterator begin() const;
ConstIterator end() const;
diff --git a/paludis/dep_tag.cc b/paludis/dep_tag.cc
index 5d9a460..e904a35 100644
--- a/paludis/dep_tag.cc
+++ b/paludis/dep_tag.cc
@@ -26,7 +26,6 @@
#include <paludis/util/instantiation_policy-impl.hh>
#include <paludis/util/set-impl.hh>
#include <paludis/util/mutex.hh>
-#include <libwrapiter/libwrapiter_forward_iterator.hh>
#include <sstream>
using namespace paludis;
@@ -50,6 +49,8 @@ template class Visits<const TargetDepTag>;
template class InstantiationPolicy<DepTagCategoryMaker, instantiation_method::SingletonTag>;
template class Set<DepTagEntry>;
+template class WrappedForwardIterator<Set<DepTagEntry>::ConstIteratorTag, const DepTagEntry>;
+template class WrappedOutputIterator<Set<DepTagEntry>::InserterTag, DepTagEntry>;
#include <paludis/dep_tag-sr.cc>
diff --git a/paludis/environment.cc b/paludis/environment.cc
index 8ee26b4..03280f3 100644
--- a/paludis/environment.cc
+++ b/paludis/environment.cc
@@ -21,10 +21,14 @@
#include <paludis/util/exception.hh>
#include <paludis/util/stringify.hh>
#include <paludis/util/sequence-impl.hh>
+#include <paludis/util/wrapped_forward_iterator-impl.hh>
+#include <paludis/util/wrapped_output_iterator-impl.hh>
using namespace paludis;
template class Sequence<std::string>;
+template class WrappedForwardIterator<Sequence<std::string>::ConstIteratorTag, const std::string>;
+template class WrappedOutputIterator<Sequence<std::string>::InserterTag, std::string>;
Environment::~Environment()
{
diff --git a/paludis/environment_implementation.cc b/paludis/environment_implementation.cc
index abb417e..2e497d9 100644
--- a/paludis/environment_implementation.cc
+++ b/paludis/environment_implementation.cc
@@ -29,8 +29,6 @@
#include <paludis/util/system.hh>
#include <paludis/hook.hh>
#include <paludis/distribution.hh>
-#include <libwrapiter/libwrapiter_forward_iterator.hh>
-#include <libwrapiter/libwrapiter_output_iterator.hh>
#include <algorithm>
#include "config.h"
diff --git a/paludis/environments/no_config/no_config_environment.cc b/paludis/environments/no_config/no_config_environment.cc
index ceecf85..278eb31 100644
--- a/paludis/environments/no_config/no_config_environment.cc
+++ b/paludis/environments/no_config/no_config_environment.cc
@@ -21,19 +21,20 @@
#include <paludis/util/tokeniser.hh>
#include <paludis/util/log.hh>
#include <paludis/util/dir_iterator.hh>
+#include <paludis/util/wrapped_forward_iterator.hh>
#include <paludis/util/map.hh>
#include <paludis/util/set.hh>
#include <paludis/util/sequence.hh>
+#include <paludis/util/create_iterator-impl.hh>
#include <paludis/util/make_shared_ptr.hh>
#include <paludis/repository_maker.hh>
#include <paludis/util/private_implementation_pattern-impl.hh>
#include <paludis/util/config_file.hh>
+#include <paludis/util/wrapped_output_iterator.hh>
#include <paludis/distribution.hh>
#include <paludis/package_database.hh>
#include <paludis/hook.hh>
#include <paludis/repositories/e/e_repository_params.hh>
-#include <libwrapiter/libwrapiter_forward_iterator.hh>
-#include <libwrapiter/libwrapiter_output_iterator.hh>
#include <set>
#include <list>
diff --git a/paludis/environments/no_config/no_config_environment.hh b/paludis/environments/no_config/no_config_environment.hh
index 2ad970c..9c49b06 100644
--- a/paludis/environments/no_config/no_config_environment.hh
+++ b/paludis/environments/no_config/no_config_environment.hh
@@ -25,7 +25,6 @@
#include <paludis/util/private_implementation_pattern.hh>
#include <paludis/util/sr.hh>
#include <paludis/util/map-fwd.hh>
-#include <libwrapiter/libwrapiter_forward_iterator-fwd.hh>
namespace paludis
{
diff --git a/paludis/environments/paludis/keywords_conf.cc b/paludis/environments/paludis/keywords_conf.cc
index 3ceead0..410e68e 100644
--- a/paludis/environments/paludis/keywords_conf.cc
+++ b/paludis/environments/paludis/keywords_conf.cc
@@ -30,10 +30,10 @@
#include <paludis/util/log.hh>
#include <paludis/util/private_implementation_pattern-impl.hh>
#include <paludis/util/tokeniser.hh>
+#include <paludis/util/iterator_funcs.hh>
+#include <paludis/util/wrapped_forward_iterator.hh>
#include <paludis/util/mutex.hh>
#include <paludis/util/set.hh>
-#include <libwrapiter/libwrapiter_forward_iterator.hh>
-#include <libwrapiter/libwrapiter_output_iterator.hh>
#include <list>
#include <vector>
#include <map>
diff --git a/paludis/environments/paludis/licenses_conf.cc b/paludis/environments/paludis/licenses_conf.cc
index 51c1b84..7978fe8 100644
--- a/paludis/environments/paludis/licenses_conf.cc
+++ b/paludis/environments/paludis/licenses_conf.cc
@@ -31,7 +31,8 @@
#include <paludis/util/tokeniser.hh>
#include <paludis/util/private_implementation_pattern-impl.hh>
#include <paludis/util/mutex.hh>
-#include <libwrapiter/libwrapiter_forward_iterator.hh>
+#include <paludis/util/wrapped_forward_iterator.hh>
+#include <paludis/util/iterator_funcs.hh>
#include <list>
#include <vector>
#include <map>
diff --git a/paludis/environments/paludis/mirrors_conf.cc b/paludis/environments/paludis/mirrors_conf.cc
index cc0cda5..56cc93f 100644
--- a/paludis/environments/paludis/mirrors_conf.cc
+++ b/paludis/environments/paludis/mirrors_conf.cc
@@ -28,8 +28,9 @@
#include <paludis/util/tokeniser.hh>
#include <paludis/util/tr1_functional.hh>
#include <paludis/util/sequence.hh>
-#include <libwrapiter/libwrapiter_forward_iterator.hh>
-#include <libwrapiter/libwrapiter_output_iterator.hh>
+#include <paludis/util/iterator_funcs.hh>
+#include <paludis/util/wrapped_forward_iterator.hh>
+#include <paludis/util/wrapped_output_iterator.hh>
#include <vector>
using namespace paludis;
@@ -90,8 +91,8 @@ MirrorsConf::query(const std::string & m) const
{
tr1::shared_ptr<MirrorsSequence> result(new MirrorsSequence);
std::pair<Mirrors::const_iterator, Mirrors::const_iterator> p(_imp->mirrors.equal_range(m));
- std::copy(p.first, p.second, transform_inserter(result->back_inserter(),
- paludis::tr1::mem_fn(&std::pair<const std::string, std::string>::second)));
+ std::transform(p.first, p.second, result->back_inserter(),
+ paludis::tr1::mem_fn(&std::pair<const std::string, std::string>::second));
return result;
}
diff --git a/paludis/environments/paludis/package_mask_conf.cc b/paludis/environments/paludis/package_mask_conf.cc
index 857fb39..c53ff45 100644
--- a/paludis/environments/paludis/package_mask_conf.cc
+++ b/paludis/environments/paludis/package_mask_conf.cc
@@ -28,12 +28,13 @@
#include <paludis/environments/paludis/paludis_environment.hh>
#include <paludis/environments/paludis/bashable_conf.hh>
#include <paludis/util/log.hh>
+#include <paludis/util/wrapped_forward_iterator.hh>
#include <paludis/util/tokeniser.hh>
#include <paludis/util/private_implementation_pattern-impl.hh>
+#include <paludis/util/indirect_iterator-impl.hh>
#include <list>
#include <algorithm>
#include <paludis/util/tr1_functional.hh>
-#include <libwrapiter/libwrapiter_forward_iterator.hh>
using namespace paludis;
using namespace paludis::paludis_environment;
diff --git a/paludis/environments/paludis/paludis_config.cc b/paludis/environments/paludis/paludis_config.cc
index 5617e31..652c6e1 100644
--- a/paludis/environments/paludis/paludis_config.cc
+++ b/paludis/environments/paludis/paludis_config.cc
@@ -29,7 +29,6 @@
#include <paludis/distribution.hh>
#include <paludis/util/destringify.hh>
#include <paludis/util/dir_iterator.hh>
-#include <paludis/util/iterator.hh>
#include <paludis/util/fs_entry.hh>
#include <paludis/util/is_file_with_extension.hh>
#include <paludis/util/log.hh>
@@ -43,6 +42,8 @@
#include <paludis/util/tokeniser.hh>
#include <paludis/util/private_implementation_pattern-impl.hh>
#include <paludis/util/mutex.hh>
+#include <paludis/util/wrapped_output_iterator.hh>
+#include <paludis/util/wrapped_forward_iterator-impl.hh>
#include <paludis/util/tr1_functional.hh>
#include <fstream>
@@ -56,9 +57,6 @@
#include <sys/types.h>
#include <pwd.h>
-#include <libwrapiter/libwrapiter_forward_iterator.hh>
-#include <libwrapiter/libwrapiter_output_iterator.hh>
-
#include "config.h"
/** \file
@@ -70,6 +68,8 @@
using namespace paludis;
using namespace paludis::paludis_environment;
+template class WrappedForwardIterator<PaludisConfig::RepositoryConstIteratorTag, const RepositoryConfigEntry>;
+
#include <paludis/environments/paludis/use_config_entry-sr.cc>
#include <paludis/environments/paludis/repository_config_entry-sr.cc>
@@ -319,10 +319,10 @@ PaludisConfig::PaludisConfig(PaludisEnvironment * const e, const std::string & s
if (! dir->exists())
continue;
- std::copy(DirIterator(*dir), DirIterator(),
- filter_inserter(std::back_inserter(repo_files), tr1::bind(&is_file_with_extension, _1, ".conf", IsFileWithOptions())));
- std::copy(DirIterator(*dir), DirIterator(),
- filter_inserter(std::back_inserter(repo_files), tr1::bind(&is_file_with_extension, _1, ".bash", IsFileWithOptions())));
+ std::remove_copy_if(DirIterator(*dir), DirIterator(), std::back_inserter(repo_files),
+ tr1::bind(std::logical_not<bool>(), tr1::bind(&is_file_with_extension, _1, ".conf", IsFileWithOptions())));
+ std::remove_copy_if(DirIterator(*dir), DirIterator(), std::back_inserter(repo_files),
+ tr1::bind(std::logical_not<bool>(), tr1::bind(&is_file_with_extension, _1, ".bash", IsFileWithOptions())));
}
std::list<tr1::shared_ptr<Map<std::string, std::string> > > later_keys;
@@ -365,13 +365,13 @@ PaludisConfig::PaludisConfig(PaludisEnvironment * const e, const std::string & s
tr1::shared_ptr<Map<std::string, std::string> > keys(new Map<std::string, std::string>);
std::copy(kv->begin(), kv->end(), keys->inserter());
- keys->erase("importance");
+ keys->erase(stringify("importance"));
keys->insert("importance", stringify(importance));
- keys->erase("repo_file");
+ keys->erase(stringify("repo_file"));
keys->insert("repo_file", stringify(*repo_file));
- keys->erase("root");
+ keys->erase(stringify("root"));
keys->insert("root", root_prefix.empty() ? "/" : root_prefix);
if (! kv->get("master_repository").empty())
@@ -403,10 +403,10 @@ PaludisConfig::PaludisConfig(PaludisEnvironment * const e, const std::string & s
files.push_back(local_config_dir / "keywords.bash");
if ((local_config_dir / "keywords.conf.d").exists())
{
- std::copy(DirIterator(local_config_dir / "keywords.conf.d"), DirIterator(),
- filter_inserter(std::back_inserter(files), tr1::bind(&is_file_with_extension, _1, ".conf", IsFileWithOptions())));
- std::copy(DirIterator(local_config_dir / "keywords.conf.d"), DirIterator(),
- filter_inserter(std::back_inserter(files), tr1::bind(&is_file_with_extension, _1, ".bash", IsFileWithOptions())));
+ std::remove_copy_if(DirIterator(local_config_dir / "keywords.conf.d"), DirIterator(), std::back_inserter(files),
+ tr1::bind(std::logical_not<bool>(), tr1::bind(&is_file_with_extension, _1, ".conf", IsFileWithOptions())));
+ std::remove_copy_if(DirIterator(local_config_dir / "keywords.conf.d"), DirIterator(), std::back_inserter(files),
+ tr1::bind(std::logical_not<bool>(), tr1::bind(&is_file_with_extension, _1, ".bash", IsFileWithOptions())));
}
for (std::list<FSEntry>::const_iterator file(files.begin()), file_end(files.end()) ;
@@ -428,10 +428,10 @@ PaludisConfig::PaludisConfig(PaludisEnvironment * const e, const std::string & s
files.push_back(local_config_dir / "use.bash");
if ((local_config_dir / "use.conf.d").exists())
{
- std::copy(DirIterator(local_config_dir / "use.conf.d"), DirIterator(),
- filter_inserter(std::back_inserter(files), tr1::bind(&is_file_with_extension, _1, ".conf", IsFileWithOptions())));
- std::copy(DirIterator(local_config_dir / "use.conf.d"), DirIterator(),
- filter_inserter(std::back_inserter(files), tr1::bind(&is_file_with_extension, _1, ".bash", IsFileWithOptions())));
+ std::remove_copy_if(DirIterator(local_config_dir / "use.conf.d"), DirIterator(), std::back_inserter(files),
+ tr1::bind(std::logical_not<bool>(), tr1::bind(&is_file_with_extension, _1, ".conf", IsFileWithOptions())));
+ std::remove_copy_if(DirIterator(local_config_dir / "use.conf.d"), DirIterator(), std::back_inserter(files),
+ tr1::bind(std::logical_not<bool>(), tr1::bind(&is_file_with_extension, _1, ".bash", IsFileWithOptions())));
}
for (std::list<FSEntry>::const_iterator file(files.begin()), file_end(files.end()) ;
@@ -453,10 +453,10 @@ PaludisConfig::PaludisConfig(PaludisEnvironment * const e, const std::string & s
files.push_back(local_config_dir / "licenses.bash");
if ((local_config_dir / "licenses.conf.d").exists())
{
- std::copy(DirIterator(local_config_dir / "licenses.conf.d"), DirIterator(),
- filter_inserter(std::back_inserter(files), tr1::bind(&is_file_with_extension, _1, ".conf", IsFileWithOptions())));
- std::copy(DirIterator(local_config_dir / "licenses.conf.d"), DirIterator(),
- filter_inserter(std::back_inserter(files), tr1::bind(&is_file_with_extension, _1, ".bash", IsFileWithOptions())));
+ std::remove_copy_if(DirIterator(local_config_dir / "licenses.conf.d"), DirIterator(), std::back_inserter(files),
+ tr1::bind(std::logical_not<bool>(), tr1::bind(&is_file_with_extension, _1, ".conf", IsFileWithOptions())));
+ std::remove_copy_if(DirIterator(local_config_dir / "licenses.conf.d"), DirIterator(), std::back_inserter(files),
+ tr1::bind(std::logical_not<bool>(), tr1::bind(&is_file_with_extension, _1, ".bash", IsFileWithOptions())));
}
for (std::list<FSEntry>::const_iterator file(files.begin()), file_end(files.end()) ;
@@ -478,10 +478,10 @@ PaludisConfig::PaludisConfig(PaludisEnvironment * const e, const std::string & s
files.push_back(local_config_dir / "package_mask.bash");
if ((local_config_dir / "package_mask.conf.d").exists())
{
- std::copy(DirIterator(local_config_dir / "package_mask.conf.d"), DirIterator(),
- filter_inserter(std::back_inserter(files), tr1::bind(&is_file_with_extension, _1, ".conf", IsFileWithOptions())));
- std::copy(DirIterator(local_config_dir / "package_mask.conf.d"), DirIterator(),
- filter_inserter(std::back_inserter(files), tr1::bind(&is_file_with_extension, _1, ".bash", IsFileWithOptions())));
+ std::remove_copy_if(DirIterator(local_config_dir / "package_mask.conf.d"), DirIterator(), std::back_inserter(files),
+ tr1::bind(std::logical_not<bool>(), tr1::bind(&is_file_with_extension, _1, ".conf", IsFileWithOptions())));
+ std::remove_copy_if(DirIterator(local_config_dir / "package_mask.conf.d"), DirIterator(), std::back_inserter(files),
+ tr1::bind(std::logical_not<bool>(), tr1::bind(&is_file_with_extension, _1, ".bash", IsFileWithOptions())));
}
for (std::list<FSEntry>::const_iterator file(files.begin()), file_end(files.end()) ;
@@ -503,10 +503,10 @@ PaludisConfig::PaludisConfig(PaludisEnvironment * const e, const std::string & s
files.push_back(local_config_dir / "package_unmask.bash");
if ((local_config_dir / "package_unmask.conf.d").exists())
{
- std::copy(DirIterator(local_config_dir / "package_unmask.conf.d"), DirIterator(),
- filter_inserter(std::back_inserter(files), tr1::bind(&is_file_with_extension, _1, ".conf", IsFileWithOptions())));
- std::copy(DirIterator(local_config_dir / "package_unmask.conf.d"), DirIterator(),
- filter_inserter(std::back_inserter(files), tr1::bind(&is_file_with_extension, _1, ".bash", IsFileWithOptions())));
+ std::remove_copy_if(DirIterator(local_config_dir / "package_unmask.conf.d"), DirIterator(), std::back_inserter(files),
+ tr1::bind(std::logical_not<bool>(), tr1::bind(&is_file_with_extension, _1, ".conf", IsFileWithOptions())));
+ std::remove_copy_if(DirIterator(local_config_dir / "package_unmask.conf.d"), DirIterator(), std::back_inserter(files),
+ tr1::bind(std::logical_not<bool>(), tr1::bind(&is_file_with_extension, _1, ".bash", IsFileWithOptions())));
}
for (std::list<FSEntry>::const_iterator file(files.begin()), file_end(files.end()) ;
@@ -528,10 +528,10 @@ PaludisConfig::PaludisConfig(PaludisEnvironment * const e, const std::string & s
files.push_back(local_config_dir / "mirrors.bash");
if ((local_config_dir / "mirrors.conf.d").exists())
{
- std::copy(DirIterator(local_config_dir / "mirrors.conf.d"), DirIterator(),
- filter_inserter(std::back_inserter(files), tr1::bind(&is_file_with_extension, _1, ".conf", IsFileWithOptions())));
- std::copy(DirIterator(local_config_dir / "mirrors.conf.d"), DirIterator(),
- filter_inserter(std::back_inserter(files), tr1::bind(&is_file_with_extension, _1, ".bash", IsFileWithOptions())));
+ std::remove_copy_if(DirIterator(local_config_dir / "mirrors.conf.d"), DirIterator(), std::back_inserter(files),
+ tr1::bind(std::logical_not<bool>(), tr1::bind(&is_file_with_extension, _1, ".conf", IsFileWithOptions())));
+ std::remove_copy_if(DirIterator(local_config_dir / "mirrors.conf.d"), DirIterator(), std::back_inserter(files),
+ tr1::bind(std::logical_not<bool>(), tr1::bind(&is_file_with_extension, _1, ".bash", IsFileWithOptions())));
}
for (std::list<FSEntry>::const_iterator file(files.begin()), file_end(files.end()) ;
diff --git a/paludis/environments/paludis/paludis_config.hh b/paludis/environments/paludis/paludis_config.hh
index 666864a..efaa3c2 100644
--- a/paludis/environments/paludis/paludis_config.hh
+++ b/paludis/environments/paludis/paludis_config.hh
@@ -27,6 +27,7 @@
#include <paludis/util/sr.hh>
#include <paludis/util/sequence-fwd.hh>
#include <paludis/util/map-fwd.hh>
+#include <paludis/util/wrapped_forward_iterator-fwd.hh>
#include <paludis/environment_maker.hh>
#include <string>
@@ -124,7 +125,7 @@ namespace paludis
///\name Iterate over our repositories
///\{
- typedef libwrapiter::ForwardIterator<PaludisConfig, const RepositoryConfigEntry> RepositoryConstIterator;
+ typedef WrappedForwardIterator<enum RepositoryConstIteratorTag { }, const RepositoryConfigEntry> RepositoryConstIterator;
RepositoryConstIterator begin_repositories() const;
diff --git a/paludis/environments/paludis/paludis_environment.cc b/paludis/environments/paludis/paludis_environment.cc
index 6b9088d..7d2b8dd 100644
--- a/paludis/environments/paludis/paludis_environment.cc
+++ b/paludis/environments/paludis/paludis_environment.cc
@@ -36,6 +36,7 @@
#include <paludis/package_id.hh>
#include <paludis/mask.hh>
+#include <paludis/util/wrapped_forward_iterator.hh>
#include <paludis/util/log.hh>
#include <paludis/util/system.hh>
#include <paludis/util/dir_iterator.hh>
@@ -49,8 +50,8 @@
#include <paludis/util/sequence.hh>
#include <paludis/util/mutex.hh>
#include <paludis/util/map.hh>
-#include <libwrapiter/libwrapiter_forward_iterator.hh>
-#include <libwrapiter/libwrapiter_output_iterator.hh>
+#include <paludis/util/wrapped_output_iterator.hh>
+
#include <functional>
#include <algorithm>
#include <list>
@@ -297,8 +298,8 @@ PaludisEnvironment::hook_dirs() const
_imp->need_hook_dirs(_imp->config->config_dir());
tr1::shared_ptr<FSEntrySequence> result(new FSEntrySequence);
- std::copy(_imp->hook_dirs.begin(), _imp->hook_dirs.end(),
- transform_inserter(result->back_inserter(), tr1::mem_fn(&std::pair<FSEntry, bool>::first)));
+ std::transform(_imp->hook_dirs.begin(), _imp->hook_dirs.end(), result->back_inserter(),
+ tr1::mem_fn(&std::pair<FSEntry, bool>::first));
return result;
}
@@ -465,7 +466,7 @@ namespace
class BreaksPortageMask :
public UnsupportedMask
{
- const char key() const
+ char key() const
{
return 'B';
}
@@ -484,7 +485,7 @@ namespace
class UserConfigMask :
public UserMask
{
- const char key() const
+ char key() const
{
return 'U';
}
diff --git a/paludis/environments/paludis/paludis_environment_TEST.cc b/paludis/environments/paludis/paludis_environment_TEST.cc
index d6ff229..92d7c4c 100644
--- a/paludis/environments/paludis/paludis_environment_TEST.cc
+++ b/paludis/environments/paludis/paludis_environment_TEST.cc
@@ -22,12 +22,11 @@
#include <paludis/util/fs_entry.hh>
#include <paludis/util/sequence.hh>
#include <paludis/util/set.hh>
+#include <paludis/util/wrapped_forward_iterator.hh>
#include <paludis/query.hh>
#include <paludis/package_id.hh>
#include <test/test_runner.hh>
#include <test/test_framework.hh>
-#include <libwrapiter/libwrapiter_forward_iterator.hh>
-#include <libwrapiter/libwrapiter_output_iterator.hh>
#include <cstdlib>
using namespace paludis;
diff --git a/paludis/environments/paludis/use_conf.cc b/paludis/environments/paludis/use_conf.cc
index 6a9b22c..49d076c 100644
--- a/paludis/environments/paludis/use_conf.cc
+++ b/paludis/environments/paludis/use_conf.cc
@@ -30,14 +30,13 @@
#include <paludis/util/log.hh>
#include <paludis/util/tokeniser.hh>
#include <paludis/util/private_implementation_pattern-impl.hh>
-#include <paludis/util/iterator.hh>
+#include <paludis/util/iterator_funcs.hh>
#include <paludis/util/strip.hh>
+#include <paludis/util/wrapped_forward_iterator.hh>
#include <paludis/util/set.hh>
#include <paludis/util/mutex.hh>
#include <list>
#include <vector>
-#include <libwrapiter/libwrapiter_forward_iterator.hh>
-#include <libwrapiter/libwrapiter_output_iterator.hh>
using namespace paludis;
using namespace paludis::paludis_environment;
diff --git a/paludis/environments/portage/portage_environment.cc b/paludis/environments/portage/portage_environment.cc
index 6ed94fd..90074d5 100644
--- a/paludis/environments/portage/portage_environment.cc
+++ b/paludis/environments/portage/portage_environment.cc
@@ -21,10 +21,13 @@
#include <paludis/util/log.hh>
#include <paludis/util/tokeniser.hh>
#include <paludis/util/system.hh>
+#include <paludis/util/wrapped_forward_iterator.hh>
+#include <paludis/util/create_iterator-impl.hh>
+#include <paludis/util/iterator_funcs.hh>
#include <paludis/util/save.hh>
#include <paludis/util/private_implementation_pattern-impl.hh>
-#include <paludis/util/iterator.hh>
#include <paludis/util/dir_iterator.hh>
+#include <paludis/util/wrapped_output_iterator.hh>
#include <paludis/util/strip.hh>
#include <paludis/util/set.hh>
#include <paludis/util/sequence.hh>
@@ -42,8 +45,6 @@
#include <algorithm>
#include <paludis/util/tr1_functional.hh>
#include <paludis/util/mutex.hh>
-#include <libwrapiter/libwrapiter_forward_iterator.hh>
-#include <libwrapiter/libwrapiter_output_iterator.hh>
#include <functional>
#include <set>
#include <map>
@@ -651,8 +652,8 @@ PortageEnvironment::mirrors(const std::string & m) const
std::pair<std::multimap<std::string, std::string>::const_iterator, std::multimap<std::string, std::string>::const_iterator>
p(_imp->mirrors.equal_range(m));
tr1::shared_ptr<MirrorsSequence> result(new MirrorsSequence);
- std::copy(p.first, p.second, transform_inserter(result->back_inserter(),
- tr1::mem_fn(&std::pair<const std::string, std::string>::second)));
+ std::transform(p.first, p.second, result->back_inserter(),
+ tr1::mem_fn(&std::pair<const std::string, std::string>::second));
return result;
}
@@ -673,7 +674,7 @@ namespace
class BreaksPortageMask :
public UnsupportedMask
{
- const char key() const
+ char key() const
{
return 'B';
}
@@ -692,7 +693,7 @@ namespace
class UserConfigMask :
public UserMask
{
- const char key() const
+ char key() const
{
return 'U';
}
diff --git a/paludis/environments/portage/portage_environment_TEST.cc b/paludis/environments/portage/portage_environment_TEST.cc
index 4168aff..b65eb3a 100644
--- a/paludis/environments/portage/portage_environment_TEST.cc
+++ b/paludis/environments/portage/portage_environment_TEST.cc
@@ -23,13 +23,12 @@
#include <paludis/util/join.hh>
#include <paludis/util/set.hh>
#include <paludis/util/sequence.hh>
+#include <paludis/util/wrapped_forward_iterator.hh>
#include <paludis/package_id.hh>
#include <paludis/query.hh>
#include <paludis/package_database.hh>
#include <paludis/dep_spec.hh>
#include <paludis/name.hh>
-#include <libwrapiter/libwrapiter_forward_iterator.hh>
-#include <libwrapiter/libwrapiter_output_iterator.hh>
using namespace paludis;
using namespace test;
diff --git a/paludis/environments/test/test_environment.cc b/paludis/environments/test/test_environment.cc
index 70560bbd..a42834c 100644
--- a/paludis/environments/test/test_environment.cc
+++ b/paludis/environments/test/test_environment.cc
@@ -21,13 +21,12 @@
#include <paludis/util/private_implementation_pattern-impl.hh>
#include <paludis/util/tr1_functional.hh>
#include <paludis/util/set.hh>
+#include <paludis/util/wrapped_forward_iterator.hh>
#include <paludis/util/sequence.hh>
#include <paludis/util/make_shared_ptr.hh>
#include <paludis/package_database.hh>
#include <paludis/package_id.hh>
#include <paludis/hook.hh>
-#include <libwrapiter/libwrapiter_forward_iterator.hh>
-#include <libwrapiter/libwrapiter_output_iterator.hh>
#include <string>
using namespace paludis;
diff --git a/paludis/find_unused_packages_task.cc b/paludis/find_unused_packages_task.cc
index fcd8b3a..315b4f8 100644
--- a/paludis/find_unused_packages_task.cc
+++ b/paludis/find_unused_packages_task.cc
@@ -25,11 +25,10 @@
#include <paludis/package_database.hh>
#include <paludis/metadata_key.hh>
#include <paludis/package_id.hh>
+#include <paludis/util/wrapped_forward_iterator.hh>
#include <paludis/util/tokeniser.hh>
#include <paludis/util/sequence.hh>
#include <paludis/util/set.hh>
-#include <libwrapiter/libwrapiter_forward_iterator.hh>
-#include <libwrapiter/libwrapiter_output_iterator.hh>
#include <set>
diff --git a/paludis/formatter.hh b/paludis/formatter.hh
index ad28c62..48be6c2 100644
--- a/paludis/formatter.hh
+++ b/paludis/formatter.hh
@@ -1067,6 +1067,7 @@ namespace paludis
FormatFunctionsByProxy<T13_, typename format::CategorySelector<T13_>::Category, 13>(&t),
FormatFunctionsByProxy<T14_, typename format::CategorySelector<T14_>::Category, 14>(&t),
FormatFunctionsByProxy<T15_, typename format::CategorySelector<T15_>::Category, 15>(&t),
+ CanSpace(),
_proxy(&t)
{
}
diff --git a/paludis/fuzzy_finder.cc b/paludis/fuzzy_finder.cc
index 899adea..2e62a42 100644
--- a/paludis/fuzzy_finder.cc
+++ b/paludis/fuzzy_finder.cc
@@ -19,20 +19,24 @@
#include <paludis/fuzzy_finder.hh>
#include <paludis/util/private_implementation_pattern-impl.hh>
+#include <paludis/util/wrapped_forward_iterator-impl.hh>
#include <paludis/util/damerau_levenshtein.hh>
#include <paludis/package_database.hh>
#include <paludis/environment.hh>
#include <paludis/repository.hh>
#include <paludis/name.hh>
#include <paludis/util/set.hh>
-#include <libwrapiter/libwrapiter_forward_iterator.hh>
#include <list>
+#include <algorithm>
#include <set>
#include <cctype>
using namespace paludis;
+template class WrappedForwardIterator<FuzzyCandidatesFinder::CandidatesConstIteratorTag, const QualifiedPackageName>;
+template class WrappedForwardIterator<FuzzyRepositoriesFinder::RepositoriesConstIteratorTag, const RepositoryName>;
+
namespace
{
bool char_0_cost(char c)
diff --git a/paludis/fuzzy_finder.hh b/paludis/fuzzy_finder.hh
index c7f1968..01a892c 100644
--- a/paludis/fuzzy_finder.hh
+++ b/paludis/fuzzy_finder.hh
@@ -22,7 +22,7 @@
#include <paludis/environment-fwd.hh>
#include <paludis/util/private_implementation_pattern.hh>
-#include <libwrapiter/libwrapiter_forward_iterator.hh>
+#include <paludis/util/wrapped_forward_iterator-fwd.hh>
#include <paludis/name.hh>
#include <string>
@@ -54,7 +54,7 @@ namespace paludis
///\name Iterate over the candidates
///\{
- typedef libwrapiter::ForwardIterator<FuzzyCandidatesFinder, const QualifiedPackageName>
+ typedef WrappedForwardIterator<enum CandidatesConstIteratorTag { }, const QualifiedPackageName>
CandidatesConstIterator;
CandidatesConstIterator begin() const;
@@ -83,7 +83,7 @@ namespace paludis
///\name Iterate over the candidates
///\{
- typedef libwrapiter::ForwardIterator<FuzzyRepositoriesFinder, const RepositoryName>
+ typedef WrappedForwardIterator<enum RepositoriesConstIteratorTag { }, const RepositoryName>
RepositoriesConstIterator;
RepositoriesConstIterator begin() const;
diff --git a/paludis/hook.cc b/paludis/hook.cc
index 2407401..8fe54d8 100644
--- a/paludis/hook.cc
+++ b/paludis/hook.cc
@@ -22,12 +22,15 @@
#include <paludis/util/private_implementation_pattern-impl.hh>
#include <paludis/util/exception.hh>
#include <paludis/util/stringify.hh>
-#include <libwrapiter/libwrapiter_forward_iterator.hh>
+#include <paludis/util/wrapped_forward_iterator-impl.hh>
+#include <utility>
#include <map>
#include <set>
using namespace paludis;
+template class WrappedForwardIterator<Hook::ConstIteratorTag, const std::pair<const std::string, std::string> >;
+
#include <paludis/hook-se.cc>
#include <paludis/hook-sr.cc>
diff --git a/paludis/hook.hh b/paludis/hook.hh
index c1c81ed..3081c62 100644
--- a/paludis/hook.hh
+++ b/paludis/hook.hh
@@ -27,9 +27,9 @@
#include <paludis/util/graph-fwd.hh>
#include <paludis/util/private_implementation_pattern.hh>
#include <paludis/util/operators.hh>
+#include <paludis/util/wrapped_forward_iterator-fwd.hh>
#include <string>
-#include <libwrapiter/libwrapiter_forward_iterator-fwd.hh>
/** \file
* Declarations for the Hook classes.
@@ -87,7 +87,7 @@ namespace paludis
///\name Iterate over environment data
///\{
- typedef libwrapiter::ForwardIterator<Hook, const std::pair<const std::string, std::string> > ConstIterator;
+ typedef WrappedForwardIterator<enum ConstIteratorTag { }, const std::pair<const std::string, std::string> > ConstIterator;
ConstIterator begin() const
PALUDIS_ATTRIBUTE((warn_unused_result));
diff --git a/paludis/install_task.cc b/paludis/install_task.cc
index 777e399..d9ed094 100644
--- a/paludis/install_task.cc
+++ b/paludis/install_task.cc
@@ -22,7 +22,6 @@
#include <paludis/action.hh>
#include <paludis/metadata_key.hh>
#include <paludis/util/exception.hh>
-#include <paludis/util/iterator.hh>
#include <paludis/util/private_implementation_pattern-impl.hh>
#include <paludis/util/tr1_functional.hh>
#include <paludis/query.hh>
@@ -36,9 +35,9 @@
#include <paludis/util/tokeniser.hh>
#include <paludis/util/set.hh>
#include <paludis/util/log.hh>
+#include <paludis/util/iterator_funcs.hh>
+#include <paludis/util/wrapped_forward_iterator-impl.hh>
#include <paludis/handled_information.hh>
-#include <libwrapiter/libwrapiter_forward_iterator.hh>
-#include <libwrapiter/libwrapiter_output_iterator.hh>
#include <functional>
#include <algorithm>
#include <list>
@@ -46,6 +45,8 @@
using namespace paludis;
+template class WrappedForwardIterator<InstallTask::TargetsConstIteratorTag, const std::string>;
+
#include <paludis/install_task-se.cc>
namespace paludis
diff --git a/paludis/install_task.hh b/paludis/install_task.hh
index 9688d06..b5c4f72 100644
--- a/paludis/install_task.hh
+++ b/paludis/install_task.hh
@@ -22,13 +22,13 @@
#include <paludis/util/instantiation_policy.hh>
#include <paludis/util/private_implementation_pattern.hh>
+#include <paludis/util/wrapped_forward_iterator-fwd.hh>
#include <paludis/dep_list.hh>
#include <paludis/dep_list_exceptions.hh>
#include <paludis/tasks_exceptions.hh>
#include <paludis/repository-fwd.hh>
#include <paludis/action-fwd.hh>
#include <paludis/package_database-fwd.hh>
-#include <libwrapiter/libwrapiter_forward_iterator-fwd.hh>
/** \file
* Declarations for InstallTask.
@@ -110,7 +110,7 @@ namespace paludis
bool had_package_targets() const PALUDIS_ATTRIBUTE((warn_unused_result));
void override_target_type(const DepListTargetType);
- typedef libwrapiter::ForwardIterator<InstallTask, const std::string> TargetsConstIterator;
+ typedef WrappedForwardIterator<enum TargetsConstIteratorTag { }, const std::string> TargetsConstIterator;
TargetsConstIterator begin_targets() const PALUDIS_ATTRIBUTE((warn_unused_result));
TargetsConstIterator end_targets() const PALUDIS_ATTRIBUTE((warn_unused_result));
diff --git a/paludis/match_package.cc b/paludis/match_package.cc
index f529f12..f2d38f6 100644
--- a/paludis/match_package.cc
+++ b/paludis/match_package.cc
@@ -26,7 +26,6 @@
#include <paludis/package_id.hh>
#include <paludis/util/visitor-impl.hh>
#include <paludis/util/tr1_functional.hh>
-#include <libwrapiter/libwrapiter_forward_iterator.hh>
#include <algorithm>
using namespace paludis;
diff --git a/paludis/merger_TEST.cc b/paludis/merger_TEST.cc
index 1a4ae5c..1385614 100644
--- a/paludis/merger_TEST.cc
+++ b/paludis/merger_TEST.cc
@@ -20,6 +20,7 @@
#include "merger.hh"
#include <paludis/environments/test/test_environment.hh>
#include <paludis/hooker.hh>
+#include <paludis/util/wrapped_forward_iterator.hh>
#include <paludis/hook.hh>
#include <test/test_framework.hh>
#include <test/test_runner.hh>
diff --git a/paludis/name.cc b/paludis/name.cc
index 7e42f3d..c56a208 100644
--- a/paludis/name.cc
+++ b/paludis/name.cc
@@ -23,6 +23,8 @@
#include <paludis/util/log.hh>
#include <paludis/util/sequence-impl.hh>
#include <paludis/util/set-impl.hh>
+#include <paludis/util/wrapped_forward_iterator-impl.hh>
+#include <paludis/util/wrapped_output_iterator-impl.hh>
#include <ostream>
#include <utility>
@@ -32,14 +34,39 @@ using namespace paludis;
#include <paludis/name-se.cc>
template struct Sequence<RepositoryName>;
+template struct WrappedForwardIterator<Sequence<RepositoryName>::ConstIteratorTag, const RepositoryName>;
+
template struct Set<PackageNamePart>;
+template struct WrappedForwardIterator<Set<PackageNamePart>::ConstIteratorTag, const PackageNamePart>;
+template struct WrappedOutputIterator<Set<PackageNamePart>::InserterTag, PackageNamePart>;
+
template struct Set<CategoryNamePart>;
+template struct WrappedForwardIterator<Set<CategoryNamePart>::ConstIteratorTag, const CategoryNamePart>;
+template struct WrappedOutputIterator<Set<CategoryNamePart>::InserterTag, CategoryNamePart>;
+
template struct Set<UseFlagName>;
+template struct WrappedForwardIterator<Set<UseFlagName>::ConstIteratorTag, const UseFlagName>;
+template struct WrappedOutputIterator<Set<UseFlagName>::InserterTag, UseFlagName>;
+
template struct Set<QualifiedPackageName>;
+template struct WrappedForwardIterator<Set<QualifiedPackageName>::ConstIteratorTag, const QualifiedPackageName>;
+template struct WrappedOutputIterator<Set<QualifiedPackageName>::InserterTag, QualifiedPackageName>;
+
template struct Set<KeywordName>;
+template struct WrappedForwardIterator<Set<KeywordName>::ConstIteratorTag, const KeywordName>;
+template struct WrappedOutputIterator<Set<KeywordName>::InserterTag, KeywordName>;
+
template struct Set<SetName>;
+template struct WrappedForwardIterator<Set<SetName>::ConstIteratorTag, const SetName>;
+template struct WrappedOutputIterator<Set<SetName>::InserterTag, SetName>;
+
template struct Set<IUseFlag>;
+template struct WrappedForwardIterator<Set<IUseFlag>::ConstIteratorTag, const IUseFlag>;
+template struct WrappedOutputIterator<Set<IUseFlag>::InserterTag, IUseFlag>;
+
template struct Set<std::string>;
+template struct WrappedForwardIterator<Set<std::string>::ConstIteratorTag, const std::string>;
+template struct WrappedOutputIterator<Set<std::string>::InserterTag, std::string>;
QualifiedPackageNameError::QualifiedPackageNameError(const std::string & s) throw () :
NameError(s, "qualified package name")
diff --git a/paludis/package_database.cc b/paludis/package_database.cc
index d4176b5..86cfabe 100644
--- a/paludis/package_database.cc
+++ b/paludis/package_database.cc
@@ -23,28 +23,31 @@
#include <paludis/package_id.hh>
#include <paludis/environment.hh>
#include <paludis/util/log.hh>
-#include <paludis/util/iterator.hh>
#include <paludis/util/private_implementation_pattern-impl.hh>
#include <paludis/util/stringify.hh>
#include <paludis/util/join.hh>
-#include <paludis/util/iterator.hh>
+#include <paludis/util/indirect_iterator-impl.hh>
+#include <paludis/util/iterator_funcs.hh>
+#include <paludis/util/member_iterator-impl.hh>
#include <paludis/util/set.hh>
#include <paludis/util/map.hh>
#include <paludis/util/map-impl.hh>
#include <paludis/util/sequence.hh>
#include <paludis/util/sequence-impl.hh>
#include <paludis/util/tr1_functional.hh>
+#include <paludis/util/wrapped_forward_iterator-impl.hh>
+#include <paludis/util/member_iterator.hh>
#include <paludis/query.hh>
-#include <libwrapiter/libwrapiter_forward_iterator.hh>
-#include <libwrapiter/libwrapiter_output_iterator.hh>
-
#include <list>
#include <map>
#include <set>
using namespace paludis;
+template class WrappedForwardIterator<AmbiguousPackageNameError::OptionsConstIteratorTag, const std::string>;
+template class WrappedForwardIterator<PackageDatabase::RepositoryConstIteratorTag, const tr1::shared_ptr<Repository> >;
+
#include "package_database-se.cc"
PackageDatabaseError::PackageDatabaseError(const std::string & our_message) throw () :
@@ -323,10 +326,12 @@ PackageDatabase::query(const Query & q, const QueryOrder query_order) const
repos->push_back((*r)->name());
}
if (repos->empty())
+ {
if (qo_require_exactly_one == query_order)
throw NonUniqueQueryResultError(q, result);
else
return result;
+ }
tr1::shared_ptr<CategoryNamePartSet> cats(q.categories(*_imp->environment, repos));
if (! cats)
@@ -340,10 +345,12 @@ PackageDatabase::query(const Query & q, const QueryOrder query_order) const
}
}
if (cats->empty())
+ {
if (qo_require_exactly_one == query_order)
throw NonUniqueQueryResultError(q, result);
else
return result;
+ }
tr1::shared_ptr<QualifiedPackageNameSet> pkgs(q.packages(*_imp->environment, repos, cats));
if (! pkgs)
@@ -359,10 +366,12 @@ PackageDatabase::query(const Query & q, const QueryOrder query_order) const
}
}
if (pkgs->empty())
+ {
if (qo_require_exactly_one == query_order)
throw NonUniqueQueryResultError(q, result);
else
return result;
+ }
tr1::shared_ptr<PackageIDSequence> ids(q.ids(*_imp->environment, repos, pkgs));
if (! ids)
@@ -379,10 +388,12 @@ PackageDatabase::query(const Query & q, const QueryOrder query_order) const
else
{
if (ids->empty())
+ {
if (qo_require_exactly_one == query_order)
throw NonUniqueQueryResultError(q, result);
else
return result;
+ }
std::copy(ids->begin(), ids->end(), result->back_inserter());
}
@@ -442,8 +453,7 @@ PackageDatabase::query(const Query & q, const QueryOrder query_order) const
}
result.reset(new PackageIDSequence);
- std::copy(best.begin(), best.end(), transform_inserter(result->back_inserter(),
- tr1::mem_fn(&std::pair<const QualifiedPackageName, tr1::shared_ptr<const PackageID> >::second)));
+ std::copy(second_iterator(best.begin()), second_iterator(best.end()), result->back_inserter());
}
continue;
@@ -461,9 +471,7 @@ PackageDatabase::query(const Query & q, const QueryOrder query_order) const
}
result.reset(new PackageIDSequence);
- std::copy(best.begin(), best.end(), transform_inserter(result->back_inserter(),
- tr1::mem_fn(&std::pair<const std::pair<QualifiedPackageName, SlotName>,
- tr1::shared_ptr<const PackageID> >::second)));
+ std::copy(second_iterator(best.begin()), second_iterator(best.end()), result->back_inserter());
result->sort(tr1::cref(c));
}
continue;
diff --git a/paludis/package_database.hh b/paludis/package_database.hh
index eedd905..53939c9 100644
--- a/paludis/package_database.hh
+++ b/paludis/package_database.hh
@@ -26,16 +26,15 @@
#include <paludis/repository.hh>
#include <paludis/query-fwd.hh>
#include <paludis/util/exception.hh>
-#include <paludis/util/iterator.hh>
#include <paludis/util/instantiation_policy.hh>
#include <paludis/util/join.hh>
#include <paludis/util/private_implementation_pattern.hh>
#include <paludis/util/stringify.hh>
+#include <paludis/util/wrapped_forward_iterator-fwd.hh>
#include <paludis/version_spec.hh>
#include <paludis/contents.hh>
#include <iosfwd>
-#include <libwrapiter/libwrapiter_forward_iterator-fwd.hh>
/** \file
* Declarations for PackageDatabase.
@@ -124,7 +123,7 @@ namespace paludis
///\name Iterate over possible matches
///\{
- typedef libwrapiter::ForwardIterator<AmbiguousPackageNameError,
+ typedef WrappedForwardIterator<enum OptionsConstIteratorTag { },
const std::string> OptionsConstIterator;
OptionsConstIterator begin_options() const PALUDIS_ATTRIBUTE((warn_unused_result));
@@ -321,7 +320,7 @@ namespace paludis
///\name Iterate over our repositories
///\{
- typedef libwrapiter::ForwardIterator<PackageDatabase, const tr1::shared_ptr<Repository> > RepositoryConstIterator;
+ typedef WrappedForwardIterator<enum RepositoryConstIteratorTag { }, const tr1::shared_ptr<Repository> > RepositoryConstIterator;
RepositoryConstIterator begin_repositories() const
PALUDIS_ATTRIBUTE((warn_unused_result));
diff --git a/paludis/package_database_TEST.cc b/paludis/package_database_TEST.cc
index 6cefaf1..61297eb 100644
--- a/paludis/package_database_TEST.cc
+++ b/paludis/package_database_TEST.cc
@@ -24,9 +24,9 @@
#include <paludis/repositories/fake/fake_installed_repository.hh>
#include <paludis/repositories/fake/fake_package_id.hh>
#include <paludis/util/sequence.hh>
+#include <paludis/util/wrapped_forward_iterator.hh>
#include <paludis/util/set.hh>
-#include <libwrapiter/libwrapiter_forward_iterator.hh>
-#include <libwrapiter/libwrapiter_output_iterator.hh>
+#include <paludis/util/indirect_iterator.hh>
#include <test/test_framework.hh>
#include <test/test_runner.hh>
@@ -269,7 +269,7 @@ namespace test_cases
result->insert(CategoryNamePart("bad-cat1"));
result->insert(CategoryNamePart("bad-cat2"));
return result;
- };
+ }
};
void run()
diff --git a/paludis/package_id.cc b/paludis/package_id.cc
index d51c11b..5824e4f 100644
--- a/paludis/package_id.cc
+++ b/paludis/package_id.cc
@@ -20,13 +20,14 @@
#include <paludis/package_id.hh>
#include <paludis/metadata_key.hh>
#include <paludis/util/private_implementation_pattern-impl.hh>
-#include <paludis/util/iterator.hh>
#include <paludis/util/tr1_functional.hh>
#include <paludis/util/sequence.hh>
#include <paludis/util/sequence-impl.hh>
#include <paludis/util/set.hh>
#include <paludis/util/set-impl.hh>
#include <paludis/util/stringify.hh>
+#include <paludis/util/wrapped_forward_iterator-impl.hh>
+#include <paludis/util/wrapped_output_iterator-impl.hh>
#include <paludis/name.hh>
#include <paludis/version_spec.hh>
#include <paludis/repository.hh>
@@ -36,14 +37,21 @@
#include <list>
#include <algorithm>
-#include <libwrapiter/libwrapiter_forward_iterator.hh>
-
using namespace paludis;
#include <paludis/package_id-se.cc>
template class Sequence<tr1::shared_ptr<const PackageID> >;
+template class WrappedForwardIterator<Sequence<tr1::shared_ptr<const PackageID> >::ConstIteratorTag,
+ const tr1::shared_ptr<const PackageID> >;
+template class WrappedOutputIterator<Sequence<tr1::shared_ptr<const PackageID> >::InserterTag,
+ tr1::shared_ptr<const PackageID> >;
+
template class Set<tr1::shared_ptr<const PackageID>, PackageIDSetComparator>;
+template class WrappedForwardIterator<Set<tr1::shared_ptr<const PackageID> >::ConstIteratorTag,
+ const tr1::shared_ptr<const PackageID> >;
+template class WrappedOutputIterator<Set<tr1::shared_ptr<const PackageID> >::InserterTag,
+ tr1::shared_ptr<const PackageID> >;
namespace paludis
{
diff --git a/paludis/package_id.hh b/paludis/package_id.hh
index 2c8f4ce..281ed57 100644
--- a/paludis/package_id.hh
+++ b/paludis/package_id.hh
@@ -27,6 +27,7 @@
#include <paludis/util/operators.hh>
#include <paludis/util/private_implementation_pattern.hh>
#include <paludis/util/tr1_memory.hh>
+#include <paludis/util/wrapped_forward_iterator-fwd.hh>
#include <paludis/action-fwd.hh>
#include <paludis/dep_spec-fwd.hh>
@@ -37,8 +38,6 @@
#include <paludis/repository-fwd.hh>
#include <paludis/version_spec-fwd.hh>
-#include <libwrapiter/libwrapiter_forward_iterator-fwd.hh>
-
/** \file
* Declarations for PackageID classes.
*
@@ -287,7 +286,7 @@ namespace paludis
///\name Finding and iterating over metadata keys
///\{
- typedef libwrapiter::ForwardIterator<PackageID, tr1::shared_ptr<const MetadataKey> > MetadataConstIterator;
+ typedef WrappedForwardIterator<enum MetadataConstIteratorTag { }, tr1::shared_ptr<const MetadataKey> > MetadataConstIterator;
MetadataConstIterator begin_metadata() const PALUDIS_ATTRIBUTE((warn_unused_result));
MetadataConstIterator end_metadata() const PALUDIS_ATTRIBUTE((warn_unused_result));
MetadataConstIterator find_metadata(const std::string &) const PALUDIS_ATTRIBUTE((warn_unused_result));
@@ -318,7 +317,7 @@ namespace paludis
///\name Masks
///\{
- typedef libwrapiter::ForwardIterator<PackageID, tr1::shared_ptr<const Mask> > MasksConstIterator;
+ typedef WrappedForwardIterator<enum MasksConstIteratorTag { }, tr1::shared_ptr<const Mask> > MasksConstIterator;
MasksConstIterator begin_masks() const PALUDIS_ATTRIBUTE((warn_unused_result));
MasksConstIterator end_masks() const PALUDIS_ATTRIBUTE((warn_unused_result));
diff --git a/paludis/paludis.hh.m4 b/paludis/paludis.hh.m4
index 69cb96c..6541a7d 100644
--- a/paludis/paludis.hh.m4
+++ b/paludis/paludis.hh.m4
@@ -41,7 +41,6 @@ addthis(`$1',`$5')addthis(`$1',`$6')')dnl
include(`paludis/files.m4')
#include <paludis/util/util.hh>
-#include <libwrapiter/libwrapiter.hh>
#endif
diff --git a/paludis/query.cc b/paludis/query.cc
index 3772fef..e1aa792 100644
--- a/paludis/query.cc
+++ b/paludis/query.cc
@@ -31,8 +31,6 @@
#include <paludis/match_package.hh>
#include <paludis/action.hh>
#include <paludis/package_id.hh>
-#include <libwrapiter/libwrapiter_forward_iterator.hh>
-#include <libwrapiter/libwrapiter_output_iterator.hh>
#include <algorithm>
#include <set>
diff --git a/paludis/query_visitor.cc b/paludis/query_visitor.cc
index 25c4a8b..0e8773e 100644
--- a/paludis/query_visitor.cc
+++ b/paludis/query_visitor.cc
@@ -27,8 +27,6 @@
#include <paludis/util/private_implementation_pattern-impl.hh>
#include <paludis/util/log.hh>
#include <paludis/util/visitor-impl.hh>
-#include <libwrapiter/libwrapiter_forward_iterator.hh>
-#include <libwrapiter/libwrapiter_output_iterator.hh>
#include <algorithm>
#include <set>
diff --git a/paludis/range_rewriter.cc b/paludis/range_rewriter.cc
index fb844b7..8437134 100644
--- a/paludis/range_rewriter.cc
+++ b/paludis/range_rewriter.cc
@@ -22,8 +22,6 @@
#include <paludis/version_requirements.hh>
#include <paludis/util/visitor-impl.hh>
#include <paludis/dep_spec.hh>
-#include <libwrapiter/libwrapiter_forward_iterator.hh>
-#include <libwrapiter/libwrapiter_output_iterator.hh>
using namespace paludis;
diff --git a/paludis/report_task.cc b/paludis/report_task.cc
index d10ce63..3bcec4e 100644
--- a/paludis/report_task.cc
+++ b/paludis/report_task.cc
@@ -29,8 +29,6 @@
#include <paludis/util/visitor-impl.hh>
#include <paludis/util/set.hh>
#include <paludis/package_database.hh>
-#include <libwrapiter/libwrapiter_forward_iterator.hh>
-#include <libwrapiter/libwrapiter_output_iterator.hh>
#include <set>
#include <map>
diff --git a/paludis/repositories/e/aa_visitor.cc b/paludis/repositories/e/aa_visitor.cc
index 4bf69d3..119fbb7 100644
--- a/paludis/repositories/e/aa_visitor.cc
+++ b/paludis/repositories/e/aa_visitor.cc
@@ -21,7 +21,7 @@
#include <paludis/repositories/e/aa_visitor.hh>
#include <paludis/util/visitor-impl.hh>
#include <paludis/util/private_implementation_pattern-impl.hh>
-#include <libwrapiter/libwrapiter_forward_iterator.hh>
+#include <paludis/util/wrapped_forward_iterator.hh>
/** \file
* Implementation of aa_visitor.hh
diff --git a/paludis/repositories/e/aa_visitor.hh b/paludis/repositories/e/aa_visitor.hh
index 18fa5e7..7df1897 100644
--- a/paludis/repositories/e/aa_visitor.hh
+++ b/paludis/repositories/e/aa_visitor.hh
@@ -23,6 +23,7 @@
#include <paludis/dep_tree.hh>
#include <paludis/dep_spec-fwd.hh>
#include <paludis/util/private_implementation_pattern.hh>
+#include <paludis/util/wrapped_forward_iterator-fwd.hh>
/** \file
* Declarations for the AAVisitor class.
@@ -68,7 +69,7 @@ namespace paludis
/// \name Iterator functions
///{
- typedef libwrapiter::ForwardIterator<AAVisitor, const std::string> ConstIterator;
+ typedef WrappedForwardIterator<enum ConstIteratorTag { }, const std::string> ConstIterator;
ConstIterator begin() const PALUDIS_ATTRIBUTE((warn_unused_result));
ConstIterator end() const PALUDIS_ATTRIBUTE((warn_unused_result));
diff --git a/paludis/repositories/e/aa_visitor_TEST.cc b/paludis/repositories/e/aa_visitor_TEST.cc
index 9dcf2b4..e1a319f 100644
--- a/paludis/repositories/e/aa_visitor_TEST.cc
+++ b/paludis/repositories/e/aa_visitor_TEST.cc
@@ -22,7 +22,6 @@
#include <paludis/util/join.hh>
#include <paludis/util/visitor-impl.hh>
#include <paludis/repositories/e/eapi.hh>
-#include <libwrapiter/libwrapiter_forward_iterator.hh>
#include <test/test_runner.hh>
#include <test/test_framework.hh>
diff --git a/paludis/repositories/e/dep_lexer.cc b/paludis/repositories/e/dep_lexer.cc
index 794f08d..90c6a7c 100644
--- a/paludis/repositories/e/dep_lexer.cc
+++ b/paludis/repositories/e/dep_lexer.cc
@@ -19,22 +19,19 @@
#include <paludis/dep_spec.hh>
#include <paludis/repositories/e/dep_lexer.hh>
+#include <paludis/util/wrapped_forward_iterator-impl.hh>
#include <paludis/util/private_implementation_pattern-impl.hh>
#include <paludis/util/exception.hh>
#include <paludis/util/tokeniser.hh>
-#include <libwrapiter/libwrapiter_forward_iterator.hh>
#include <vector>
#include <list>
-/** \file
- * Implementation of dep_lexer.hh things.
- *
- * \ingroup grpdeplexer
- */
-
using namespace paludis;
using namespace paludis::erepository;
+template class WrappedForwardIterator<DepLexer::ConstIteratorTag,
+ const std::pair<DepLexerLexeme, std::string> >;
+
namespace paludis
{
/**
diff --git a/paludis/repositories/e/dep_lexer.hh b/paludis/repositories/e/dep_lexer.hh
index 7939a2a..b274d7b 100644
--- a/paludis/repositories/e/dep_lexer.hh
+++ b/paludis/repositories/e/dep_lexer.hh
@@ -23,10 +23,9 @@
#include <paludis/util/exception.hh>
#include <paludis/util/instantiation_policy.hh>
#include <paludis/util/private_implementation_pattern.hh>
+#include <paludis/util/wrapped_forward_iterator-fwd.hh>
#include <string>
-#include <libwrapiter/libwrapiter_forward_iterator-fwd.hh>
-
/** \file
* Declarations for the DepLexer class.
*
@@ -106,7 +105,7 @@ namespace paludis
///\name Iterate over our items
///\{
- typedef libwrapiter::ForwardIterator<DepLexer,
+ typedef WrappedForwardIterator<enum ConstIteratorTag { },
const std::pair<DepLexerLexeme, std::string> > ConstIterator;
ConstIterator begin() const;
diff --git a/paludis/repositories/e/dep_lexer_TEST.cc b/paludis/repositories/e/dep_lexer_TEST.cc
index 4be9c70..0300b1e 100644
--- a/paludis/repositories/e/dep_lexer_TEST.cc
+++ b/paludis/repositories/e/dep_lexer_TEST.cc
@@ -18,10 +18,10 @@
*/
#include <paludis/repositories/e/dep_lexer.hh>
+#include <paludis/util/wrapped_forward_iterator.hh>
#include <sstream>
#include <test/test_framework.hh>
#include <test/test_runner.hh>
-#include <libwrapiter/libwrapiter_forward_iterator.hh>
using namespace test;
using namespace paludis;
diff --git a/paludis/repositories/e/dep_parser.cc b/paludis/repositories/e/dep_parser.cc
index 78ab158..df96853 100644
--- a/paludis/repositories/e/dep_parser.cc
+++ b/paludis/repositories/e/dep_parser.cc
@@ -27,8 +27,7 @@
#include <paludis/util/tr1_functional.hh>
#include <paludis/util/visitor-impl.hh>
#include <paludis/util/make_shared_ptr.hh>
-#include <libwrapiter/libwrapiter_forward_iterator.hh>
-#include <libwrapiter/libwrapiter_output_iterator.hh>
+#include <paludis/util/iterator_funcs.hh>
#include <stack>
#include <set>
diff --git a/paludis/repositories/e/dep_parser_TEST.cc b/paludis/repositories/e/dep_parser_TEST.cc
index 6a42439..3d9fb10 100644
--- a/paludis/repositories/e/dep_parser_TEST.cc
+++ b/paludis/repositories/e/dep_parser_TEST.cc
@@ -22,7 +22,6 @@
#include <paludis/repositories/e/eapi.hh>
#include <paludis/util/visitor-impl.hh>
#include <paludis/stringify_formatter.hh>
-#include <libwrapiter/libwrapiter_forward_iterator.hh>
#include <sstream>
#include <test/test_framework.hh>
#include <test/test_runner.hh>
diff --git a/paludis/repositories/e/dep_spec_pretty_printer.cc b/paludis/repositories/e/dep_spec_pretty_printer.cc
index 6d2b0c8..c7132e3 100644
--- a/paludis/repositories/e/dep_spec_pretty_printer.cc
+++ b/paludis/repositories/e/dep_spec_pretty_printer.cc
@@ -30,7 +30,6 @@
#include <paludis/environment.hh>
#include <paludis/query.hh>
#include <paludis/package_database.hh>
-#include <libwrapiter/libwrapiter_forward_iterator.hh>
/** \file
* Implementation of dep_spec_pretty_printer.hh.
diff --git a/paludis/repositories/e/dep_spec_pretty_printer_TEST.cc b/paludis/repositories/e/dep_spec_pretty_printer_TEST.cc
index a9b1335..203d3d2 100644
--- a/paludis/repositories/e/dep_spec_pretty_printer_TEST.cc
+++ b/paludis/repositories/e/dep_spec_pretty_printer_TEST.cc
@@ -22,7 +22,6 @@
#include <paludis/repositories/e/eapi.hh>
#include <paludis/stringify_formatter.hh>
#include <paludis/util/visitor-impl.hh>
-#include <libwrapiter/libwrapiter_forward_iterator.hh>
#include <test/test_runner.hh>
#include <test/test_framework.hh>
diff --git a/paludis/repositories/e/e_key.cc b/paludis/repositories/e/e_key.cc
index b595818..2d8caef 100644
--- a/paludis/repositories/e/e_key.cc
+++ b/paludis/repositories/e/e_key.cc
@@ -27,7 +27,6 @@
#include <paludis/util/private_implementation_pattern-impl.hh>
#include <paludis/util/stringify.hh>
#include <paludis/util/tokeniser.hh>
-#include <paludis/util/iterator.hh>
#include <paludis/util/fs_entry.hh>
#include <paludis/util/log.hh>
#include <paludis/util/mutex.hh>
@@ -35,6 +34,7 @@
#include <paludis/util/tr1_functional.hh>
#include <paludis/util/join.hh>
#include <paludis/util/visitor-impl.hh>
+#include <paludis/util/create_iterator-impl.hh>
#include <paludis/contents.hh>
#include <paludis/repository.hh>
@@ -42,9 +42,6 @@
#include <paludis/stringify_formatter-impl.hh>
#include <paludis/dep_spec_flattener.hh>
-#include <libwrapiter/libwrapiter_forward_iterator.hh>
-#include <libwrapiter/libwrapiter_output_iterator.hh>
-
#include <list>
#include <vector>
#include <fstream>
@@ -1071,7 +1068,7 @@ ECTimeKey::~ECTimeKey()
{
}
-const time_t
+time_t
ECTimeKey::value() const
{
Lock l(_imp->value_mutex);
diff --git a/paludis/repositories/e/e_key.hh b/paludis/repositories/e/e_key.hh
index 4bd3b37..054446e 100644
--- a/paludis/repositories/e/e_key.hh
+++ b/paludis/repositories/e/e_key.hh
@@ -323,7 +323,7 @@ namespace paludis
const std::string &, const std::string &, const FSEntry &, const MetadataKeyType);
~ECTimeKey();
- const time_t value() const
+ time_t value() const
PALUDIS_ATTRIBUTE((warn_unused_result));
};
diff --git a/paludis/repositories/e/e_mask.cc b/paludis/repositories/e/e_mask.cc
index 9bb3405..06623f3 100644
--- a/paludis/repositories/e/e_mask.cc
+++ b/paludis/repositories/e/e_mask.cc
@@ -50,7 +50,7 @@ EUnacceptedMask::~EUnacceptedMask()
{
}
-const char
+char
EUnacceptedMask::key() const
{
return _imp->key;
@@ -95,7 +95,7 @@ EUnsupportedMask::~EUnsupportedMask()
{
}
-const char
+char
EUnsupportedMask::key() const
{
return _imp->key;
@@ -142,7 +142,7 @@ ERepositoryMask::~ERepositoryMask()
{
}
-const char
+char
ERepositoryMask::key() const
{
return _imp->key;
diff --git a/paludis/repositories/e/e_mask.hh b/paludis/repositories/e/e_mask.hh
index 27bc51e..5d34d62 100644
--- a/paludis/repositories/e/e_mask.hh
+++ b/paludis/repositories/e/e_mask.hh
@@ -35,7 +35,7 @@ namespace paludis
EUnacceptedMask(const char, const std::string &, const tr1::shared_ptr<const MetadataKey> &);
~EUnacceptedMask();
- const char key() const;
+ char key() const;
const std::string description() const;
const tr1::shared_ptr<const MetadataKey> unaccepted_key() const;
};
@@ -48,7 +48,7 @@ namespace paludis
EUnsupportedMask(const char, const std::string &, const std::string &);
~EUnsupportedMask();
- virtual const char key() const;
+ virtual char key() const;
virtual const std::string description() const;
virtual const std::string explanation() const;
};
@@ -61,7 +61,7 @@ namespace paludis
ERepositoryMask(const char, const std::string &, const tr1::shared_ptr<const MetadataKey> &);
~ERepositoryMask();
- const char key() const;
+ virtual char key() const;
const std::string description() const;
const tr1::shared_ptr<const MetadataKey> mask_key() const;
};
diff --git a/paludis/repositories/e/e_repository.cc b/paludis/repositories/e/e_repository.cc
index 1123ae2..7cb1fd0 100644
--- a/paludis/repositories/e/e_repository.cc
+++ b/paludis/repositories/e/e_repository.cc
@@ -39,6 +39,7 @@
#include <paludis/repository_info.hh>
#include <paludis/util/config_file.hh>
+#include <paludis/util/create_iterator-impl.hh>
#include <paludis/distribution.hh>
#include <paludis/dep_spec.hh>
#include <paludis/environment.hh>
@@ -53,12 +54,12 @@
#include <paludis/qa.hh>
#include <paludis/util/fs_entry.hh>
-#include <paludis/util/iterator.hh>
#include <paludis/util/log.hh>
#include <paludis/util/random.hh>
#include <paludis/util/options.hh>
#include <paludis/util/make_shared_ptr.hh>
#include <paludis/util/stringify.hh>
+#include <paludis/util/iterator_funcs.hh>
#include <paludis/util/tokeniser.hh>
#include <paludis/util/private_implementation_pattern-impl.hh>
#include <paludis/util/map.hh>
@@ -74,9 +75,6 @@
#include <paludis/rmd160.hh>
#include <paludis/sha256.hh>
-#include <libwrapiter/libwrapiter_forward_iterator.hh>
-#include <libwrapiter/libwrapiter_output_iterator.hh>
-
#include <map>
#include <set>
#include <functional>
@@ -702,9 +700,8 @@ ERepository::info(bool verbose) const
{
using namespace tr1::placeholders;
std::set<VersionSpec> versions;
- std::copy(q->begin(), q->end(),
- transform_inserter(std::inserter(versions, versions.begin()),
- tr1::bind<const VersionSpec>(tr1::mem_fn(&PackageID::version), _1)));
+ std::transform(q->begin(), q->end(), std::inserter(versions, versions.begin()),
+ tr1::bind<const VersionSpec>(tr1::mem_fn(&PackageID::version), _1));
package_info->add_kv(*i, join(versions.begin(), versions.end(), ", "));
}
}
diff --git a/paludis/repositories/e/e_repository_TEST.cc b/paludis/repositories/e/e_repository_TEST.cc
index bf75604..13ee7f1 100644
--- a/paludis/repositories/e/e_repository_TEST.cc
+++ b/paludis/repositories/e/e_repository_TEST.cc
@@ -35,8 +35,6 @@
#include <paludis/query.hh>
#include <paludis/action.hh>
#include <paludis/stringify_formatter.hh>
-#include <libwrapiter/libwrapiter_forward_iterator.hh>
-#include <libwrapiter/libwrapiter_output_iterator.hh>
#include <test/test_framework.hh>
#include <test/test_runner.hh>
diff --git a/paludis/repositories/e/e_repository_mask_file.cc b/paludis/repositories/e/e_repository_mask_file.cc
index 6bafed6..f681af7 100644
--- a/paludis/repositories/e/e_repository_mask_file.cc
+++ b/paludis/repositories/e/e_repository_mask_file.cc
@@ -21,18 +21,20 @@
#include <paludis/util/private_implementation_pattern-impl.hh>
#include <paludis/util/options.hh>
#include <paludis/util/sequence.hh>
+#include <paludis/util/wrapped_forward_iterator-impl.hh>
#include <paludis/util/strip.hh>
#include <paludis/util/config_file.hh>
+#include <paludis/util/wrapped_output_iterator.hh>
#include <paludis/mask.hh>
-#include <libwrapiter/libwrapiter_forward_iterator-impl.hh>
-#include <libwrapiter/libwrapiter_output_iterator-impl.hh>
-
#include <list>
using namespace paludis;
using namespace paludis::erepository;
+template class WrappedForwardIterator<MaskFile::ConstIteratorTag,
+ const std::pair<const std::string, tr1::shared_ptr<const RepositoryMaskInfo> > >;
+
namespace paludis
{
template <>
diff --git a/paludis/repositories/e/e_repository_mask_file.hh b/paludis/repositories/e/e_repository_mask_file.hh
index bc200b9..80d167f 100644
--- a/paludis/repositories/e/e_repository_mask_file.hh
+++ b/paludis/repositories/e/e_repository_mask_file.hh
@@ -26,8 +26,6 @@
#include <paludis/util/config_file.hh>
#include <paludis/mask-fwd.hh>
-#include <libwrapiter/libwrapiter_forward_iterator-fwd.hh>
-
namespace paludis
{
namespace erepository
@@ -54,7 +52,7 @@ namespace paludis
///\name Iterate over our mask lines.
///\{
- typedef libwrapiter::ForwardIterator<MaskFile,
+ typedef WrappedForwardIterator<enum ConstIteratorTag { },
const std::pair<const std::string, tr1::shared_ptr<const RepositoryMaskInfo> > > ConstIterator;
ConstIterator begin() const;
ConstIterator end() const;
diff --git a/paludis/repositories/e/e_repository_news.cc b/paludis/repositories/e/e_repository_news.cc
index 37c2cec..45dbb38 100644
--- a/paludis/repositories/e/e_repository_news.cc
+++ b/paludis/repositories/e/e_repository_news.cc
@@ -29,8 +29,8 @@
#include <paludis/util/private_implementation_pattern-impl.hh>
#include <paludis/util/sequence.hh>
#include <paludis/util/options.hh>
+#include <paludis/util/wrapped_forward_iterator-impl.hh>
#include <paludis/query.hh>
-#include <libwrapiter/libwrapiter_forward_iterator.hh>
#include <set>
#include <ostream>
@@ -39,6 +39,10 @@
using namespace paludis;
+template class WrappedForwardIterator<NewsFile::DisplayIfInstalledConstIteratorTag, const std::string>;
+template class WrappedForwardIterator<NewsFile::DisplayIfKeywordConstIteratorTag, const std::string>;
+template class WrappedForwardIterator<NewsFile::DisplayIfProfileConstIteratorTag, const std::string>;
+
namespace paludis
{
/**
diff --git a/paludis/repositories/e/e_repository_news.hh b/paludis/repositories/e/e_repository_news.hh
index 3f25770..8cade35 100644
--- a/paludis/repositories/e/e_repository_news.hh
+++ b/paludis/repositories/e/e_repository_news.hh
@@ -23,6 +23,7 @@
#include <paludis/util/private_implementation_pattern.hh>
#include <paludis/util/instantiation_policy.hh>
#include <paludis/util/config_file.hh>
+#include <paludis/util/wrapped_forward_iterator-fwd.hh>
/** \file
* Declaration for the ERepositoryNews class.
@@ -84,10 +85,7 @@ namespace paludis
///\name Iterate over our Display-If-Installed headers
///\{
- /// Tag for DisplayIfInstalledConstIterator.
- struct DisplayIfInstalledConstIteratorTag;
-
- typedef libwrapiter::ForwardIterator<DisplayIfInstalledConstIteratorTag,
+ typedef WrappedForwardIterator<enum DisplayIfInstalledConstIteratorTag { },
const std::string> DisplayIfInstalledConstIterator;
DisplayIfInstalledConstIterator begin_display_if_installed() const;
@@ -99,10 +97,7 @@ namespace paludis
///\name Iterate over our Display-If-Keyword headers
///\{
- /// Tag for DisplayIfKeywordConstIterator.
- struct DisplayIfKeywordConstIteratorTag;
-
- typedef libwrapiter::ForwardIterator<DisplayIfKeywordConstIteratorTag,
+ typedef WrappedForwardIterator<enum DisplayIfKeywordConstIteratorTag { },
const std::string> DisplayIfKeywordConstIterator;
DisplayIfKeywordConstIterator begin_display_if_keyword() const;
@@ -114,10 +109,7 @@ namespace paludis
///\name Iterate over our Display-If-Profile headers
///\{
- /// Tag for DisplayIfProfileConstIterator.
- struct DisplayIfProfileConstIteratorTag;
-
- typedef libwrapiter::ForwardIterator<DisplayIfProfileConstIteratorTag,
+ typedef WrappedForwardIterator<enum DisplayIfProfileConstIteratorTag { },
const std::string> DisplayIfProfileConstIterator;
DisplayIfProfileConstIterator begin_display_if_profile() const;
diff --git a/paludis/repositories/e/e_repository_profile.cc b/paludis/repositories/e/e_repository_profile.cc
index cdf885e..5d684bc 100644
--- a/paludis/repositories/e/e_repository_profile.cc
+++ b/paludis/repositories/e/e_repository_profile.cc
@@ -27,13 +27,15 @@
#include <paludis/util/log.hh>
#include <paludis/util/tokeniser.hh>
#include <paludis/util/private_implementation_pattern-impl.hh>
-#include <paludis/util/iterator.hh>
#include <paludis/util/save.hh>
#include <paludis/util/system.hh>
+#include <paludis/util/wrapped_forward_iterator-impl.hh>
#include <paludis/util/join.hh>
#include <paludis/util/sequence.hh>
#include <paludis/util/set.hh>
#include <paludis/util/options.hh>
+#include <paludis/util/iterator_funcs.hh>
+#include <paludis/util/create_iterator-impl.hh>
#include <paludis/util/config_file.hh>
#include <paludis/dep_tag.hh>
#include <paludis/environment.hh>
@@ -42,8 +44,6 @@
#include <paludis/distribution.hh>
#include <paludis/package_id.hh>
#include <paludis/metadata_key.hh>
-#include <libwrapiter/libwrapiter_forward_iterator.hh>
-#include <libwrapiter/libwrapiter_output_iterator.hh>
#include <list>
#include <algorithm>
@@ -55,12 +55,17 @@
using namespace paludis;
+template class WrappedForwardIterator<ERepositoryProfile::UseExpandConstIteratorTag, const UseFlagName>;
+template class WrappedForwardIterator<ERepositoryProfile::VirtualsConstIteratorTag,
+ const std::pair<const QualifiedPackageName, tr1::shared_ptr<const PackageDepSpec> > >;
+
namespace
{
typedef MakeHashedSet<UseFlagName>::Type UseFlagSet;
typedef MakeHashedMap<std::string, std::string>::Type EnvironmentVariablesMap;
typedef MakeHashedMap<QualifiedPackageName, tr1::shared_ptr<const PackageDepSpec> >::Type VirtualsMap;
- typedef MakeHashedMap<QualifiedPackageName, std::list<std::pair<tr1::shared_ptr<const PackageDepSpec>, tr1::shared_ptr<const RepositoryMaskInfo> > > >::Type PackageMaskMap;
+ typedef MakeHashedMap<QualifiedPackageName,
+ std::list<std::pair<tr1::shared_ptr<const PackageDepSpec>, tr1::shared_ptr<const RepositoryMaskInfo> > > >::Type PackageMaskMap;
typedef MakeHashedMap<UseFlagName, bool>::Type FlagStatusMap;
typedef std::list<std::pair<tr1::shared_ptr<const PackageDepSpec>, FlagStatusMap> > PackageFlagStatusMapList;
diff --git a/paludis/repositories/e/e_repository_profile.hh b/paludis/repositories/e/e_repository_profile.hh
index db44b19..e0fb8bf 100644
--- a/paludis/repositories/e/e_repository_profile.hh
+++ b/paludis/repositories/e/e_repository_profile.hh
@@ -29,8 +29,6 @@
#include <paludis/util/fs_entry-fwd.hh>
#include <paludis/util/private_implementation_pattern.hh>
#include <paludis/util/instantiation_policy.hh>
-
-#include <libwrapiter/libwrapiter_forward_iterator-fwd.hh>
#include <string>
/** \file
@@ -85,7 +83,7 @@ namespace paludis
///\name Iterate over USE_EXPAND, USE_EXPAND_HIDDEN
///\{
- typedef libwrapiter::ForwardIterator<ERepositoryProfile, const UseFlagName> UseExpandConstIterator;
+ typedef WrappedForwardIterator<enum UseExpandConstIteratorTag { }, const UseFlagName> UseExpandConstIterator;
UseExpandConstIterator begin_use_expand() const;
UseExpandConstIterator end_use_expand() const;
@@ -119,7 +117,7 @@ namespace paludis
///\name Virtuals
///\{
- typedef libwrapiter::ForwardIterator<ERepositoryProfile,
+ typedef WrappedForwardIterator<enum VirtualsConstIteratorTag { },
const std::pair<const QualifiedPackageName, tr1::shared_ptr<const PackageDepSpec> > > VirtualsConstIterator;
VirtualsConstIterator begin_virtuals() const;
diff --git a/paludis/repositories/e/e_repository_profile_file.cc b/paludis/repositories/e/e_repository_profile_file.cc
index a05d277..0be48f9 100644
--- a/paludis/repositories/e/e_repository_profile_file.cc
+++ b/paludis/repositories/e/e_repository_profile_file.cc
@@ -23,11 +23,10 @@
#include <paludis/util/log.hh>
#include <paludis/util/stringify.hh>
#include <paludis/util/config_file.hh>
+#include <paludis/util/wrapped_forward_iterator-impl.hh>
#include <paludis/util/private_implementation_pattern-impl.hh>
#include <paludis/util/options.hh>
#include <paludis/mask.hh>
-#include <libwrapiter/libwrapiter_forward_iterator.hh>
-#include <libwrapiter/libwrapiter_output_iterator.hh>
#include <list>
#include <algorithm>
@@ -37,18 +36,21 @@ using namespace paludis::erepository;
namespace
{
template <typename T_>
- struct FileEntryTraits
+ struct FileEntryTraits;
+
+ template<>
+ struct FileEntryTraits<std::string>
{
- static const T_ & extract_key(const T_ & k)
+ static const std::string extract_key(const std::string & k)
{
return k;
}
};
template <typename F_, typename S_>
- struct FileEntryTraits<const std::pair<F_, S_> >
+ struct FileEntryTraits<std::pair<F_, S_> >
{
- static const F_ & extract_key(const std::pair<F_, S_> & p)
+ static const std::string extract_key(const std::pair<F_, S_> & p)
{
return p.first;
}
@@ -67,7 +69,7 @@ namespace
template <typename U_>
bool operator() (const U_ & y)
{
- return FileEntryTraits<const U_>::extract_key(y) == _x;
+ return FileEntryTraits<U_>::extract_key(y) == _x;
}
};
}
@@ -77,7 +79,8 @@ namespace paludis
template <typename F_>
struct Implementation<ProfileFile<F_> >
{
- typedef std::list<typename tr1::remove_const<typename F_::ConstIterator::value_type>::type> Lines;
+ typedef std::list<typename tr1::remove_const<typename tr1::remove_reference<
+ typename F_::ConstIterator::value_type>::type>::type> Lines;
Lines lines;
};
}
@@ -94,7 +97,8 @@ ProfileFile<F_>::add_file(const FSEntry & f)
F_ file(f, LineConfigFileOptions());
for (typename F_::ConstIterator line(file.begin()), line_end(file.end()) ; line != line_end ; ++line)
{
- const std::string & key(FileEntryTraits<typename F_::ConstIterator::value_type>::extract_key(*line));
+ const std::string & key(FileEntryTraits<typename tr1::remove_const<typename tr1::remove_reference<
+ typename F_::ConstIterator::value_type>::type>::type>::extract_key(*line));
if (0 == key.compare(0, 1, "-", 0, 1))
{
typename Implementation<ProfileFile>::Lines::iterator i(
@@ -141,5 +145,8 @@ ProfileFile<F_>::end() const
}
template class ProfileFile<LineConfigFile>;
+template class WrappedForwardIterator<ProfileFile<LineConfigFile>::ConstIteratorTag, LineConfigFile::ConstIterator::value_type>;
+
template class ProfileFile<MaskFile>;
+template class WrappedForwardIterator<ProfileFile<MaskFile>::ConstIteratorTag, MaskFile::ConstIterator::value_type>;
diff --git a/paludis/repositories/e/e_repository_profile_file.hh b/paludis/repositories/e/e_repository_profile_file.hh
index ddf967b..9bf0efe 100644
--- a/paludis/repositories/e/e_repository_profile_file.hh
+++ b/paludis/repositories/e/e_repository_profile_file.hh
@@ -23,8 +23,8 @@
#include <paludis/util/private_implementation_pattern.hh>
#include <paludis/util/attributes.hh>
#include <paludis/util/fs_entry.hh>
+#include <paludis/util/wrapped_forward_iterator-fwd.hh>
#include <paludis/mask-fwd.hh>
-#include <libwrapiter/libwrapiter_forward_iterator-fwd.hh>
namespace paludis
{
@@ -58,7 +58,7 @@ namespace paludis
///\name Iterate over our profile lines.
///\{
- typedef libwrapiter::ForwardIterator<ProfileFile, typename F_::ConstIterator::value_type> ConstIterator;
+ typedef WrappedForwardIterator<enum ConstIteratorTag { }, typename F_::ConstIterator::value_type> ConstIterator;
ConstIterator begin() const;
ConstIterator end() const;
diff --git a/paludis/repositories/e/e_repository_sets.cc b/paludis/repositories/e/e_repository_sets.cc
index 36f8ebd..70f8608 100644
--- a/paludis/repositories/e/e_repository_sets.cc
+++ b/paludis/repositories/e/e_repository_sets.cc
@@ -35,6 +35,7 @@
#include <paludis/util/fs_entry.hh>
#include <paludis/util/is_file_with_extension.hh>
#include <paludis/util/log.hh>
+#include <paludis/util/wrapped_forward_iterator.hh>
#include <paludis/util/strip.hh>
#include <paludis/util/private_implementation_pattern-impl.hh>
#include <paludis/util/tokeniser.hh>
@@ -46,9 +47,6 @@
#include <map>
#include <set>
-#include <libwrapiter/libwrapiter_forward_iterator.hh>
-#include <libwrapiter/libwrapiter_output_iterator.hh>
-
#include "config.h"
using namespace paludis;
@@ -133,8 +131,11 @@ ERepositorySets::sets_list() const
using namespace tr1::placeholders;
std::list<FSEntry> repo_sets;
- std::copy(DirIterator(_imp->params.setsdir), DirIterator(),
- filter_inserter(std::back_inserter(repo_sets), tr1::bind(is_file_with_extension, _1, ".conf", IsFileWithOptions())));
+ std::remove_copy_if(
+ DirIterator(_imp->params.setsdir),
+ DirIterator(),
+ std::back_inserter(repo_sets),
+ tr1::bind(std::logical_not<bool>(), tr1::bind(is_file_with_extension, _1, ".conf", IsFileWithOptions())));
std::list<FSEntry>::const_iterator f(repo_sets.begin()),
f_end(repo_sets.end());
diff --git a/paludis/repositories/e/e_repository_sets_TEST.cc b/paludis/repositories/e/e_repository_sets_TEST.cc
index 460b2d9..f9cc039 100644
--- a/paludis/repositories/e/e_repository_sets_TEST.cc
+++ b/paludis/repositories/e/e_repository_sets_TEST.cc
@@ -29,8 +29,6 @@
#include <paludis/stringify_formatter.hh>
#include <test/test_framework.hh>
#include <test/test_runner.hh>
-#include <libwrapiter/libwrapiter_forward_iterator.hh>
-#include <libwrapiter/libwrapiter_output_iterator.hh>
#include "config.h"
using namespace test;
diff --git a/paludis/repositories/e/eapi.cc b/paludis/repositories/e/eapi.cc
index 4cbe391..94dbe44 100644
--- a/paludis/repositories/e/eapi.cc
+++ b/paludis/repositories/e/eapi.cc
@@ -33,12 +33,11 @@
#include <paludis/util/private_implementation_pattern-impl.hh>
#include <paludis/util/instantiation_policy-impl.hh>
#include <paludis/util/config_file.hh>
+#include <paludis/util/wrapped_output_iterator.hh>
#include <map>
#include <vector>
-#include <libwrapiter/libwrapiter_output_iterator.hh>
-
using namespace paludis;
using namespace paludis::erepository;
diff --git a/paludis/repositories/e/eapi_phase.cc b/paludis/repositories/e/eapi_phase.cc
index 3df4ab3..936dae7 100644
--- a/paludis/repositories/e/eapi_phase.cc
+++ b/paludis/repositories/e/eapi_phase.cc
@@ -21,10 +21,10 @@
#include <paludis/repositories/e/eapi.hh>
#include <paludis/util/tokeniser.hh>
#include <paludis/util/private_implementation_pattern-impl.hh>
-#include <paludis/util/iterator.hh>
#include <paludis/util/make_shared_ptr.hh>
-#include <libwrapiter/libwrapiter_forward_iterator.hh>
-#include <libwrapiter/libwrapiter_output_iterator.hh>
+#include <paludis/util/iterator_funcs.hh>
+#include <paludis/util/wrapped_forward_iterator-impl.hh>
+#include <paludis/util/indirect_iterator-impl.hh>
#include <set>
#include <algorithm>
#include <list>
@@ -32,6 +32,9 @@
using namespace paludis;
using namespace paludis::erepository;
+template class WrappedForwardIterator<EAPIPhase::ConstIteratorTag, const std::string>;
+template class WrappedForwardIterator<EAPIPhases::ConstIteratorTag, const EAPIPhase>;
+
namespace paludis
{
template <>
diff --git a/paludis/repositories/e/eapi_phase.hh b/paludis/repositories/e/eapi_phase.hh
index 5138a80..2ad74ea 100644
--- a/paludis/repositories/e/eapi_phase.hh
+++ b/paludis/repositories/e/eapi_phase.hh
@@ -21,7 +21,7 @@
#define PALUDIS_GUARD_PALUDIS_REPOSITORIES_GENTOO_EAPI_PHASE_HH 1
#include <paludis/util/private_implementation_pattern.hh>
-#include <libwrapiter/libwrapiter_forward_iterator-fwd.hh>
+#include <paludis/util/wrapped_forward_iterator-fwd.hh>
#include <string>
namespace paludis
@@ -53,7 +53,7 @@ namespace paludis
bool option(const std::string &) const;
bool option_contains(const std::string &, const std::string &) const;
- typedef libwrapiter::ForwardIterator<EAPIPhase, const std::string> ConstIterator;
+ typedef WrappedForwardIterator<enum ConstIteratorTag { }, const std::string> ConstIterator;
ConstIterator begin_commands() const;
ConstIterator end_commands() const;
@@ -82,7 +82,7 @@ namespace paludis
///\name Information about the phases
///\{
- typedef libwrapiter::ForwardIterator<EAPIPhases, const EAPIPhase> ConstIterator;
+ typedef WrappedForwardIterator<enum ConstIteratorTag { }, const EAPIPhase> ConstIterator;
ConstIterator begin_phases() const;
ConstIterator end_phases() const;
diff --git a/paludis/repositories/e/ebin.cc b/paludis/repositories/e/ebin.cc
index b488137..9c95df0 100644
--- a/paludis/repositories/e/ebin.cc
+++ b/paludis/repositories/e/ebin.cc
@@ -21,6 +21,7 @@
#include <paludis/repositories/e/dep_parser.hh>
#include <paludis/repositories/e/eapi.hh>
#include <paludis/environment.hh>
+#include <paludis/util/wrapped_forward_iterator.hh>
#include <paludis/util/system.hh>
#include <paludis/util/log.hh>
#include <paludis/util/strip.hh>
@@ -31,8 +32,6 @@
#include <paludis/metadata_key.hh>
#include <sys/resource.h>
#include <sys/time.h>
-#include <libwrapiter/libwrapiter_forward_iterator.hh>
-#include <libwrapiter/libwrapiter_output_iterator.hh>
#include <unistd.h>
using namespace paludis;
diff --git a/paludis/repositories/e/ebin_entries.cc b/paludis/repositories/e/ebin_entries.cc
index 2bea89f..7893c4f 100644
--- a/paludis/repositories/e/ebin_entries.cc
+++ b/paludis/repositories/e/ebin_entries.cc
@@ -35,8 +35,6 @@
#include <paludis/util/private_implementation_pattern-impl.hh>
#include <paludis/util/is_file_with_extension.hh>
#include <paludis/util/visitor-impl.hh>
-#include <libwrapiter/libwrapiter_forward_iterator.hh>
-#include <libwrapiter/libwrapiter_output_iterator.hh>
#include <set>
#include <fstream>
diff --git a/paludis/repositories/e/ebuild.cc b/paludis/repositories/e/ebuild.cc
index 026aff3..8715eac 100644
--- a/paludis/repositories/e/ebuild.cc
+++ b/paludis/repositories/e/ebuild.cc
@@ -32,6 +32,8 @@
#include <paludis/util/map.hh>
#include <paludis/util/join.hh>
#include <paludis/util/tokeniser.hh>
+#include <paludis/util/wrapped_forward_iterator.hh>
+#include <paludis/util/wrapped_output_iterator.hh>
#include <paludis/about.hh>
#include <paludis/environment.hh>
@@ -44,9 +46,6 @@
#include <sys/time.h>
#include <unistd.h>
-#include <libwrapiter/libwrapiter_forward_iterator.hh>
-#include <libwrapiter/libwrapiter_output_iterator.hh>
-
#include <list>
#include "config.h"
diff --git a/paludis/repositories/e/ebuild_entries.cc b/paludis/repositories/e/ebuild_entries.cc
index 4999ba1..5374be8 100644
--- a/paludis/repositories/e/ebuild_entries.cc
+++ b/paludis/repositories/e/ebuild_entries.cc
@@ -40,6 +40,7 @@
#include <paludis/util/tokeniser.hh>
#include <paludis/util/map.hh>
#include <paludis/util/system.hh>
+#include <paludis/util/create_iterator-impl.hh>
#include <paludis/util/set.hh>
#include <paludis/util/sequence.hh>
#include <paludis/util/private_implementation_pattern-impl.hh>
@@ -47,9 +48,6 @@
#include <paludis/util/visitor-impl.hh>
#include <paludis/util/tr1_functional.hh>
-#include <libwrapiter/libwrapiter_forward_iterator.hh>
-#include <libwrapiter/libwrapiter_output_iterator.hh>
-
#include <fstream>
#include <list>
#include <set>
diff --git a/paludis/repositories/e/ebuild_flat_metadata_cache.cc b/paludis/repositories/e/ebuild_flat_metadata_cache.cc
index 56d54b9..824edc2 100644
--- a/paludis/repositories/e/ebuild_flat_metadata_cache.cc
+++ b/paludis/repositories/e/ebuild_flat_metadata_cache.cc
@@ -27,7 +27,6 @@
#include <paludis/stringify_formatter.hh>
#include <paludis/repositories/e/eapi.hh>
#include <paludis/util/tr1_functional.hh>
-#include <libwrapiter/libwrapiter_forward_iterator.hh>
#include <fstream>
#include <set>
#include <list>
diff --git a/paludis/repositories/e/ebuild_id.cc b/paludis/repositories/e/ebuild_id.cc
index ccecb08..d116e95 100644
--- a/paludis/repositories/e/ebuild_id.cc
+++ b/paludis/repositories/e/ebuild_id.cc
@@ -43,8 +43,6 @@
#include <paludis/util/make_shared_ptr.hh>
#include <paludis/util/save.hh>
-#include <libwrapiter/libwrapiter_forward_iterator.hh>
-
#include <iterator>
#include <fstream>
diff --git a/paludis/repositories/e/eclass_mtimes.cc b/paludis/repositories/e/eclass_mtimes.cc
index a1d613d..40303c2 100644
--- a/paludis/repositories/e/eclass_mtimes.cc
+++ b/paludis/repositories/e/eclass_mtimes.cc
@@ -23,8 +23,7 @@
#include <paludis/util/sequence.hh>
#include <paludis/util/fs_entry.hh>
#include <paludis/util/mutex.hh>
-#include <libwrapiter/libwrapiter_forward_iterator.hh>
-#include <libwrapiter/libwrapiter_output_iterator.hh>
+#include <paludis/util/wrapped_forward_iterator.hh>
using namespace paludis;
diff --git a/paludis/repositories/e/exheres_layout.cc b/paludis/repositories/e/exheres_layout.cc
index 386323f..b195504 100644
--- a/paludis/repositories/e/exheres_layout.cc
+++ b/paludis/repositories/e/exheres_layout.cc
@@ -25,6 +25,7 @@
#include <paludis/hashed_containers.hh>
#include <paludis/package_id.hh>
#include <paludis/package_database.hh>
+#include <paludis/util/wrapped_forward_iterator.hh>
#include <paludis/util/dir_iterator.hh>
#include <paludis/util/fs_entry.hh>
#include <paludis/util/private_implementation_pattern-impl.hh>
@@ -34,12 +35,11 @@
#include <paludis/util/mutex.hh>
#include <paludis/util/stringify.hh>
#include <paludis/util/is_file_with_extension.hh>
-#include <paludis/util/iterator.hh>
+#include <paludis/util/wrapped_output_iterator.hh>
#include <paludis/util/strip.hh>
#include <paludis/util/sequence.hh>
#include <paludis/util/set.hh>
-#include <libwrapiter/libwrapiter_forward_iterator.hh>
-#include <libwrapiter/libwrapiter_output_iterator.hh>
+#include <paludis/util/wrapped_forward_iterator.hh>
#include <paludis/util/tr1_functional.hh>
#include <functional>
@@ -274,9 +274,9 @@ ExheresLayout::need_category_names_collection() const
need_category_names();
_imp->category_names_collection.reset(new CategoryNamePartSet);
- std::copy(_imp->category_names.begin(), _imp->category_names.end(),
- transform_inserter(_imp->category_names_collection->inserter(),
- tr1::mem_fn(&std::pair<const CategoryNamePart, bool>::first)));
+ std::transform(_imp->category_names.begin(), _imp->category_names.end(),
+ _imp->category_names_collection->inserter(),
+ tr1::mem_fn(&std::pair<const CategoryNamePart, bool>::first));
}
tr1::shared_ptr<const CategoryNamePartSet>
diff --git a/paludis/repositories/e/fetch_visitor_TEST.cc b/paludis/repositories/e/fetch_visitor_TEST.cc
index 815508b..488fb40 100644
--- a/paludis/repositories/e/fetch_visitor_TEST.cc
+++ b/paludis/repositories/e/fetch_visitor_TEST.cc
@@ -29,7 +29,6 @@
#include <paludis/query.hh>
#include <test/test_runner.hh>
#include <test/test_framework.hh>
-#include <libwrapiter/libwrapiter_forward_iterator.hh>
#include <fstream>
#include <iterator>
diff --git a/paludis/repositories/e/glsa.cc b/paludis/repositories/e/glsa.cc
index 3eb97b7..48dc251 100644
--- a/paludis/repositories/e/glsa.cc
+++ b/paludis/repositories/e/glsa.cc
@@ -18,12 +18,11 @@
*/
#include "glsa.hh"
-#include <paludis/util/iterator.hh>
#include <paludis/util/stringify.hh>
#include <paludis/util/private_implementation_pattern-impl.hh>
#include <paludis/util/mutex.hh>
-#include <libwrapiter/libwrapiter_forward_iterator.hh>
-#include <libwrapiter/libwrapiter_output_iterator.hh>
+#include <paludis/util/wrapped_forward_iterator-impl.hh>
+#include <paludis/util/indirect_iterator-impl.hh>
#include <list>
#include <dlfcn.h>
#include <stdint.h>
@@ -33,6 +32,10 @@
using namespace paludis;
+template class WrappedForwardIterator<GLSAPackage::ArchsConstIteratorTag, const UseFlagName>;
+template class WrappedForwardIterator<GLSAPackage::RangesConstIteratorTag, const GLSARange>;
+template class WrappedForwardIterator<GLSA::PackagesConstIteratorTag, const GLSAPackage>;
+
#include "glsa-sr.cc"
#ifdef MONOLITHIC
diff --git a/paludis/repositories/e/glsa.hh b/paludis/repositories/e/glsa.hh
index aa758db..3182c51 100644
--- a/paludis/repositories/e/glsa.hh
+++ b/paludis/repositories/e/glsa.hh
@@ -23,9 +23,9 @@
#include <paludis/util/private_implementation_pattern.hh>
#include <paludis/util/sr.hh>
#include <paludis/util/tr1_memory.hh>
+#include <paludis/util/wrapped_forward_iterator-fwd.hh>
#include <paludis/name.hh>
#include <paludis/version_spec.hh>
-#include <libwrapiter/libwrapiter_forward_iterator-fwd.hh>
#include <string>
@@ -75,7 +75,7 @@ namespace paludis
///\name Iterate over our archs.
///\{
- typedef libwrapiter::ForwardIterator<GLSAPackage, const UseFlagName> ArchsConstIterator;
+ typedef WrappedForwardIterator<enum ArchsConstIteratorTag { }, const UseFlagName> ArchsConstIterator;
ArchsConstIterator begin_archs() const;
ArchsConstIterator end_archs() const;
@@ -89,7 +89,7 @@ namespace paludis
///\name Iterate over our ranges.
///\{
- typedef libwrapiter::ForwardIterator<GLSAPackage, const GLSARange> RangesConstIterator;
+ typedef WrappedForwardIterator<enum RangesConstIteratorTag { }, const GLSARange> RangesConstIterator;
RangesConstIterator begin_unaffected() const;
RangesConstIterator end_unaffected() const;
RangesConstIterator begin_vulnerable() const;
@@ -139,7 +139,7 @@ namespace paludis
///\name Iterate over our packages.
///\{
- typedef libwrapiter::ForwardIterator<GLSA, const GLSAPackage> PackagesConstIterator;
+ typedef WrappedForwardIterator<enum PackagesConstIteratorTag { }, const GLSAPackage> PackagesConstIterator;
PackagesConstIterator begin_packages() const;
PackagesConstIterator end_packages() const;
diff --git a/paludis/repositories/e/make_ebin_repository.cc b/paludis/repositories/e/make_ebin_repository.cc
index 0e3cc26..ccbf46e 100644
--- a/paludis/repositories/e/make_ebin_repository.cc
+++ b/paludis/repositories/e/make_ebin_repository.cc
@@ -23,11 +23,12 @@
#include <paludis/util/map.hh>
#include <paludis/util/sequence.hh>
#include <paludis/util/destringify.hh>
+#include <paludis/util/create_iterator-impl.hh>
+#include <paludis/util/wrapped_forward_iterator.hh>
+#include <paludis/util/wrapped_output_iterator.hh>
#include <paludis/repositories/e/e_repository_exceptions.hh>
#include <paludis/environment.hh>
#include <paludis/distribution.hh>
-#include <libwrapiter/libwrapiter_forward_iterator.hh>
-#include <libwrapiter/libwrapiter_output_iterator.hh>
using namespace paludis;
diff --git a/paludis/repositories/e/make_ebuild_repository.cc b/paludis/repositories/e/make_ebuild_repository.cc
index c0860ff..f3db9ec 100644
--- a/paludis/repositories/e/make_ebuild_repository.cc
+++ b/paludis/repositories/e/make_ebuild_repository.cc
@@ -23,11 +23,12 @@
#include <paludis/util/map.hh>
#include <paludis/util/sequence.hh>
#include <paludis/util/destringify.hh>
+#include <paludis/util/create_iterator-impl.hh>
+#include <paludis/util/wrapped_forward_iterator.hh>
+#include <paludis/util/wrapped_output_iterator.hh>
#include <paludis/repositories/e/e_repository_exceptions.hh>
#include <paludis/environment.hh>
#include <paludis/distribution.hh>
-#include <libwrapiter/libwrapiter_forward_iterator.hh>
-#include <libwrapiter/libwrapiter_output_iterator.hh>
using namespace paludis;
diff --git a/paludis/repositories/e/manifest2_reader.cc b/paludis/repositories/e/manifest2_reader.cc
index 36d8ec2..6840d8b 100644
--- a/paludis/repositories/e/manifest2_reader.cc
+++ b/paludis/repositories/e/manifest2_reader.cc
@@ -22,27 +22,22 @@
#include <paludis/util/config_file.hh>
#include <paludis/util/destringify.hh>
#include <paludis/util/fs_entry.hh>
-#include <paludis/util/iterator.hh>
#include <paludis/util/log.hh>
#include <paludis/util/options.hh>
+#include <paludis/util/create_iterator-impl.hh>
+#include <paludis/util/wrapped_forward_iterator-impl.hh>
#include <paludis/util/tokeniser.hh>
#include <paludis/util/private_implementation_pattern-impl.hh>
-#include <libwrapiter/libwrapiter_forward_iterator.hh>
#include <list>
#include <paludis/repositories/e/manifest2_entry-sr.cc>
-
-/** \file
- * Implementation of manifest2_reader.hh
- *
- * \ingroup grpmanifest2reader
- */
-
using namespace paludis;
using namespace paludis::erepository;
+template class WrappedForwardIterator<Manifest2Reader::ConstIteratorTag, const Manifest2Entry>;
+
namespace paludis
{
template<>
diff --git a/paludis/repositories/e/manifest2_reader.hh b/paludis/repositories/e/manifest2_reader.hh
index ba33e76..02067de 100644
--- a/paludis/repositories/e/manifest2_reader.hh
+++ b/paludis/repositories/e/manifest2_reader.hh
@@ -24,6 +24,7 @@
#include <paludis/util/fs_entry-fwd.hh>
#include <paludis/util/stringify.hh>
#include <paludis/util/sr.hh>
+#include <paludis/util/wrapped_forward_iterator-fwd.hh>
#include <paludis/repositories/e/manifest2_entry-sr.hh>
@@ -72,7 +73,7 @@ namespace paludis
/// \name Iterator functions
- typedef libwrapiter::ForwardIterator<Manifest2Reader, const Manifest2Entry> ConstIterator;
+ typedef WrappedForwardIterator<enum ConstIteratorTag { }, const Manifest2Entry> ConstIterator;
ConstIterator begin() const PALUDIS_ATTRIBUTE((warn_unused_result));
ConstIterator end() const PALUDIS_ATTRIBUTE((warn_unused_result));
diff --git a/paludis/repositories/e/registration.cc b/paludis/repositories/e/registration.cc
index a8e5dd8..4529330 100644
--- a/paludis/repositories/e/registration.cc
+++ b/paludis/repositories/e/registration.cc
@@ -22,9 +22,8 @@
#include <paludis/repositories/e/make_ebin_repository.hh>
#include <paludis/repositories/e/vdb_repository.hh>
#include <paludis/util/log.hh>
+#include <paludis/util/wrapped_forward_iterator.hh>
#include <paludis/util/map.hh>
-#include <libwrapiter/libwrapiter_forward_iterator.hh>
-#include <libwrapiter/libwrapiter_output_iterator.hh>
#include "config.h"
using namespace paludis;
diff --git a/paludis/repositories/e/source_uri_finder.hh b/paludis/repositories/e/source_uri_finder.hh
index 86a2db0..c58ec1d 100644
--- a/paludis/repositories/e/source_uri_finder.hh
+++ b/paludis/repositories/e/source_uri_finder.hh
@@ -23,12 +23,11 @@
#include <paludis/util/attributes.hh>
#include <paludis/util/private_implementation_pattern.hh>
#include <paludis/util/visitor.hh>
+#include <paludis/util/wrapped_forward_iterator-fwd.hh>
#include <paludis/dep_label.hh>
#include <paludis/environment-fwd.hh>
#include <paludis/repository-fwd.hh>
-#include <libwrapiter/libwrapiter_forward_iterator-fwd.hh>
-
namespace paludis
{
namespace erepository
@@ -51,7 +50,7 @@ namespace paludis
~SourceURIFinder();
- typedef libwrapiter::ForwardIterator<SourceURIFinder, const std::pair<std::string, std::string> > ConstIterator;
+ typedef WrappedForwardIterator<enum ConstIteratorTag { }, const std::pair<std::string, std::string> > ConstIterator;
ConstIterator begin() const PALUDIS_ATTRIBUTE((warn_unused_result));
ConstIterator end() const PALUDIS_ATTRIBUTE((warn_unused_result));
diff --git a/paludis/repositories/e/source_uri_finder_TEST.cc b/paludis/repositories/e/source_uri_finder_TEST.cc
index 207f9b1..b8b6fb6 100644
--- a/paludis/repositories/e/source_uri_finder_TEST.cc
+++ b/paludis/repositories/e/source_uri_finder_TEST.cc
@@ -22,7 +22,6 @@
#include <paludis/repositories/fake/fake_repository.hh>
#include <paludis/package_database.hh>
#include <paludis/util/visitor-impl.hh>
-#include <libwrapiter/libwrapiter_forward_iterator.hh>
#include <test/test_runner.hh>
#include <test/test_framework.hh>
diff --git a/paludis/repositories/e/traditional_layout.cc b/paludis/repositories/e/traditional_layout.cc
index e51e1fe..acad127 100644
--- a/paludis/repositories/e/traditional_layout.cc
+++ b/paludis/repositories/e/traditional_layout.cc
@@ -28,13 +28,14 @@
#include <paludis/util/dir_iterator.hh>
#include <paludis/util/fs_entry.hh>
#include <paludis/util/private_implementation_pattern-impl.hh>
+#include <paludis/util/wrapped_forward_iterator.hh>
#include <paludis/util/log.hh>
#include <paludis/util/stringify.hh>
#include <paludis/util/is_file_with_extension.hh>
-#include <paludis/util/iterator.hh>
#include <paludis/util/map.hh>
#include <paludis/util/strip.hh>
#include <paludis/util/sequence.hh>
+#include <paludis/util/wrapped_output_iterator.hh>
#include <paludis/util/mutex.hh>
#include <paludis/util/set.hh>
@@ -43,9 +44,6 @@
#include <algorithm>
#include <list>
-#include <libwrapiter/libwrapiter_forward_iterator.hh>
-#include <libwrapiter/libwrapiter_output_iterator.hh>
-
using namespace paludis;
using namespace paludis::erepository;
@@ -293,9 +291,9 @@ TraditionalLayout::need_category_names_collection() const
need_category_names();
_imp->category_names_collection.reset(new CategoryNamePartSet);
- std::copy(_imp->category_names.begin(), _imp->category_names.end(),
- transform_inserter(_imp->category_names_collection->inserter(),
- tr1::mem_fn(&std::pair<const CategoryNamePart, bool>::first)));
+ std::transform(_imp->category_names.begin(), _imp->category_names.end(),
+ _imp->category_names_collection->inserter(),
+ tr1::mem_fn(&std::pair<const CategoryNamePart, bool>::first));
}
tr1::shared_ptr<const CategoryNamePartSet>
diff --git a/paludis/repositories/e/use_desc.cc b/paludis/repositories/e/use_desc.cc
index ffb4c11..7cbc2f0 100644
--- a/paludis/repositories/e/use_desc.cc
+++ b/paludis/repositories/e/use_desc.cc
@@ -27,9 +27,8 @@
#include <paludis/util/private_implementation_pattern-impl.hh>
#include <paludis/util/stringify.hh>
#include <paludis/util/strip.hh>
+#include <paludis/util/wrapped_forward_iterator.hh>
#include <paludis/util/config_file.hh>
-#include <libwrapiter/libwrapiter_forward_iterator.hh>
-#include <libwrapiter/libwrapiter_output_iterator.hh>
using namespace paludis;
diff --git a/paludis/repositories/e/vdb_merger.cc b/paludis/repositories/e/vdb_merger.cc
index 59d7c9f..4e84302 100644
--- a/paludis/repositories/e/vdb_merger.cc
+++ b/paludis/repositories/e/vdb_merger.cc
@@ -21,6 +21,7 @@
#include <paludis/util/log.hh>
#include <paludis/util/tokeniser.hh>
#include <paludis/util/system.hh>
+#include <paludis/util/wrapped_forward_iterator.hh>
#include <paludis/util/join.hh>
#include <paludis/util/private_implementation_pattern-impl.hh>
#include <paludis/util/sequence.hh>
@@ -31,8 +32,6 @@
#include <paludis/md5.hh>
#include <paludis/environment.hh>
#include <paludis/package_database.hh>
-#include <libwrapiter/libwrapiter_forward_iterator.hh>
-#include <libwrapiter/libwrapiter_output_iterator.hh>
#include <fstream>
#include <iostream>
#include <iomanip>
diff --git a/paludis/repositories/e/vdb_repository.cc b/paludis/repositories/e/vdb_repository.cc
index b5ac4f3..9e7b29c 100644
--- a/paludis/repositories/e/vdb_repository.cc
+++ b/paludis/repositories/e/vdb_repository.cc
@@ -56,7 +56,6 @@
#include <paludis/util/mutex.hh>
#include <paludis/util/fs_entry.hh>
#include <paludis/util/is_file_with_extension.hh>
-#include <paludis/util/iterator.hh>
#include <paludis/util/log.hh>
#include <paludis/util/pstream.hh>
#include <paludis/util/set.hh>
@@ -69,9 +68,6 @@
#include <paludis/util/tokeniser.hh>
#include <paludis/util/private_implementation_pattern-impl.hh>
-#include <libwrapiter/libwrapiter_forward_iterator.hh>
-#include <libwrapiter/libwrapiter_output_iterator.hh>
-
#include <fstream>
#include <functional>
#include <algorithm>
@@ -211,9 +207,8 @@ VDBRepository::category_names() const
tr1::shared_ptr<CategoryNamePartSet> result(new CategoryNamePartSet);
- std::copy(_imp->categories.begin(), _imp->categories.end(),
- transform_inserter(result->inserter(),
- tr1::mem_fn(&std::pair<const CategoryNamePart, tr1::shared_ptr<QualifiedPackageNameSet> >::first)));
+ std::transform(_imp->categories.begin(), _imp->categories.end(), result->inserter(),
+ tr1::mem_fn(&std::pair<const CategoryNamePart, tr1::shared_ptr<QualifiedPackageNameSet> >::first));
return result;
}
diff --git a/paludis/repositories/e/vdb_repository_TEST.cc b/paludis/repositories/e/vdb_repository_TEST.cc
index d6384b5..2564f71 100644
--- a/paludis/repositories/e/vdb_repository_TEST.cc
+++ b/paludis/repositories/e/vdb_repository_TEST.cc
@@ -29,8 +29,6 @@
#include <fstream>
#include <iterator>
-#include <libwrapiter/libwrapiter_forward_iterator.hh>
-
using namespace test;
using namespace paludis;
diff --git a/paludis/repositories/e/vdb_unmerger.cc b/paludis/repositories/e/vdb_unmerger.cc
index ad9366b..66949e0 100644
--- a/paludis/repositories/e/vdb_unmerger.cc
+++ b/paludis/repositories/e/vdb_unmerger.cc
@@ -32,15 +32,13 @@ using namespace paludis;
#include <paludis/repositories/e/vdb_unmerger-sr.cc>
#include <paludis/util/dir_iterator.hh>
#include <paludis/util/join.hh>
+#include <paludis/util/wrapped_forward_iterator.hh>
#include <paludis/util/log.hh>
#include <paludis/util/private_implementation_pattern-impl.hh>
#include <paludis/util/sequence.hh>
#include <paludis/util/tokeniser.hh>
#include <paludis/util/strip.hh>
-#include <libwrapiter/libwrapiter_forward_iterator.hh>
-#include <libwrapiter/libwrapiter_output_iterator.hh>
-
#include <list>
#include <map>
#include <vector>
diff --git a/paludis/repositories/fake/fake_installed_repository.cc b/paludis/repositories/fake/fake_installed_repository.cc
index 644959b..9ea6280 100644
--- a/paludis/repositories/fake/fake_installed_repository.cc
+++ b/paludis/repositories/fake/fake_installed_repository.cc
@@ -30,8 +30,6 @@
#include <paludis/dep_spec_flattener.hh>
#include <paludis/dep_spec.hh>
#include <paludis/action.hh>
-#include <libwrapiter/libwrapiter_forward_iterator.hh>
-#include <libwrapiter/libwrapiter_output_iterator.hh>
using namespace paludis;
diff --git a/paludis/repositories/fake/fake_package_id.cc b/paludis/repositories/fake/fake_package_id.cc
index 4e5a3af..6f0a1cd 100644
--- a/paludis/repositories/fake/fake_package_id.cc
+++ b/paludis/repositories/fake/fake_package_id.cc
@@ -32,15 +32,12 @@
#include <paludis/util/mutex.hh>
#include <paludis/util/private_implementation_pattern-impl.hh>
#include <paludis/util/tokeniser.hh>
-#include <paludis/util/iterator.hh>
#include <paludis/util/set.hh>
+#include <paludis/util/create_iterator-impl.hh>
#include <paludis/util/save.hh>
#include <paludis/util/visitor-impl.hh>
#include <paludis/util/make_shared_ptr.hh>
-#include <libwrapiter/libwrapiter_output_iterator.hh>
-#include <libwrapiter/libwrapiter_forward_iterator.hh>
-
#include <list>
#include <sstream>
@@ -296,7 +293,7 @@ FakeUnacceptedMask::~FakeUnacceptedMask()
{
}
-const char
+char
FakeUnacceptedMask::key() const
{
return _imp->key;
diff --git a/paludis/repositories/fake/fake_package_id.hh b/paludis/repositories/fake/fake_package_id.hh
index 69a89c9..20c3dcc 100644
--- a/paludis/repositories/fake/fake_package_id.hh
+++ b/paludis/repositories/fake/fake_package_id.hh
@@ -158,7 +158,7 @@ namespace paludis
FakeUnacceptedMask(const char, const std::string &, const tr1::shared_ptr<const MetadataKey> &);
~FakeUnacceptedMask();
- const char key() const;
+ char key() const;
const std::string description() const;
const tr1::shared_ptr<const MetadataKey> unaccepted_key() const;
};
diff --git a/paludis/repositories/fake/fake_repository.cc b/paludis/repositories/fake/fake_repository.cc
index 425c469..4f1d3a4 100644
--- a/paludis/repositories/fake/fake_repository.cc
+++ b/paludis/repositories/fake/fake_repository.cc
@@ -29,9 +29,6 @@
#include <paludis/package_id.hh>
#include <paludis/action.hh>
-#include <libwrapiter/libwrapiter_forward_iterator.hh>
-#include <libwrapiter/libwrapiter_output_iterator.hh>
-
#include <map>
using namespace paludis;
diff --git a/paludis/repositories/fake/fake_repository_base.cc b/paludis/repositories/fake/fake_repository_base.cc
index 5ffec03..54bb6ba 100644
--- a/paludis/repositories/fake/fake_repository_base.cc
+++ b/paludis/repositories/fake/fake_repository_base.cc
@@ -20,15 +20,14 @@
#include <paludis/repositories/fake/fake_repository_base.hh>
#include <paludis/repositories/fake/fake_package_id.hh>
#include <paludis/util/stringify.hh>
-#include <paludis/util/iterator.hh>
#include <paludis/util/private_implementation_pattern-impl.hh>
+#include <paludis/util/wrapped_forward_iterator.hh>
#include <paludis/util/make_shared_ptr.hh>
#include <paludis/util/tr1_functional.hh>
#include <paludis/util/set.hh>
#include <paludis/util/sequence.hh>
+#include <paludis/util/wrapped_output_iterator.hh>
#include <paludis/repository_info.hh>
-#include <libwrapiter/libwrapiter_forward_iterator.hh>
-#include <libwrapiter/libwrapiter_output_iterator.hh>
#include <map>
/** \file
@@ -237,8 +236,8 @@ tr1::shared_ptr<const SetNameSet>
FakeRepositoryBase::sets_list() const
{
tr1::shared_ptr<SetNameSet> result(new SetNameSet);
- std::copy(_imp->sets.begin(), _imp->sets.end(), transform_inserter(result->inserter(),
- tr1::mem_fn(&std::pair<const SetName, tr1::shared_ptr<SetSpecTree::ConstItem> >::first)));
+ std::transform(_imp->sets.begin(), _imp->sets.end(), result->inserter(),
+ tr1::mem_fn(&std::pair<const SetName, tr1::shared_ptr<SetSpecTree::ConstItem> >::first));
return result;
}
diff --git a/paludis/repositories/virtuals/installed_virtuals_repository.cc b/paludis/repositories/virtuals/installed_virtuals_repository.cc
index 4b7f176..aaadd75 100644
--- a/paludis/repositories/virtuals/installed_virtuals_repository.cc
+++ b/paludis/repositories/virtuals/installed_virtuals_repository.cc
@@ -36,9 +36,6 @@
#include <paludis/util/map.hh>
#include <paludis/util/mutex.hh>
-#include <libwrapiter/libwrapiter_forward_iterator.hh>
-#include <libwrapiter/libwrapiter_output_iterator.hh>
-
#include <algorithm>
#include <vector>
@@ -207,8 +204,8 @@ InstalledVirtualsRepository::package_names(const CategoryNamePart & c) const
need_ids();
tr1::shared_ptr<QualifiedPackageNameSet> result(new QualifiedPackageNameSet);
- std::copy(_imp->ids.begin(), _imp->ids.end(), transform_inserter(result->inserter(),
- tr1::mem_fn(&std::pair<const QualifiedPackageName, tr1::shared_ptr<PackageIDSequence> >::first)));
+ std::transform(_imp->ids.begin(), _imp->ids.end(), result->inserter(),
+ tr1::mem_fn(&std::pair<const QualifiedPackageName, tr1::shared_ptr<PackageIDSequence> >::first));
return result;
}
diff --git a/paludis/repositories/virtuals/package_id.cc b/paludis/repositories/virtuals/package_id.cc
index b9acbca..9cdd227 100644
--- a/paludis/repositories/virtuals/package_id.cc
+++ b/paludis/repositories/virtuals/package_id.cc
@@ -458,7 +458,7 @@ namespace
{
}
- const char key() const
+ char key() const
{
return 'A';
}
diff --git a/paludis/repositories/virtuals/virtuals_repository.cc b/paludis/repositories/virtuals/virtuals_repository.cc
index 3a448b6..21a0cdc 100644
--- a/paludis/repositories/virtuals/virtuals_repository.cc
+++ b/paludis/repositories/virtuals/virtuals_repository.cc
@@ -42,9 +42,6 @@
#include <vector>
#include <utility>
-#include <libwrapiter/libwrapiter_forward_iterator.hh>
-#include <libwrapiter/libwrapiter_output_iterator.hh>
-
using namespace paludis;
typedef MakeHashedMap<QualifiedPackageName, tr1::shared_ptr<PackageIDSequence> >::Type IDMap;
@@ -280,8 +277,8 @@ VirtualsRepository::package_names(const CategoryNamePart & c) const
need_ids();
tr1::shared_ptr<QualifiedPackageNameSet> result(new QualifiedPackageNameSet);
- std::copy(_imp->ids.begin(), _imp->ids.end(), transform_inserter(result->inserter(),
- tr1::mem_fn(&std::pair<const QualifiedPackageName, tr1::shared_ptr<PackageIDSequence> >::first)));
+ std::transform(_imp->ids.begin(), _imp->ids.end(), result->inserter(),
+ tr1::mem_fn(&std::pair<const QualifiedPackageName, tr1::shared_ptr<PackageIDSequence> >::first));
return result;
}
diff --git a/paludis/repositories/virtuals/virtuals_repository_TEST.cc b/paludis/repositories/virtuals/virtuals_repository_TEST.cc
index 135025c..d26f220 100644
--- a/paludis/repositories/virtuals/virtuals_repository_TEST.cc
+++ b/paludis/repositories/virtuals/virtuals_repository_TEST.cc
@@ -27,11 +27,11 @@
#include <paludis/environments/test/test_environment.hh>
#include <paludis/package_database.hh>
#include <paludis/util/sequence.hh>
+#include <paludis/util/wrapped_forward_iterator.hh>
+#include <paludis/util/indirect_iterator-impl.hh>
#include <paludis/util/make_shared_ptr.hh>
#include <paludis/query.hh>
-#include <libwrapiter/libwrapiter_forward_iterator.hh>
-
using namespace test;
using namespace paludis;
diff --git a/paludis/repository.cc b/paludis/repository.cc
index 998d13e..b64e01d 100644
--- a/paludis/repository.cc
+++ b/paludis/repository.cc
@@ -19,7 +19,6 @@
#include <paludis/repository.hh>
#include <paludis/repository_info.hh>
-#include <paludis/util/iterator.hh>
#include <paludis/util/log.hh>
#include <paludis/util/private_implementation_pattern-impl.hh>
#include <paludis/util/instantiation_policy-impl.hh>
@@ -31,8 +30,7 @@
#include <paludis/util/set.hh>
#include <paludis/util/set-impl.hh>
#include <paludis/util/config_file.hh>
-#include <libwrapiter/libwrapiter_forward_iterator.hh>
-#include <libwrapiter/libwrapiter_output_iterator.hh>
+#include <paludis/util/wrapped_forward_iterator-impl.hh>
#include <map>
#include <list>
#include <utility>
@@ -47,6 +45,10 @@ template class Set<tr1::shared_ptr<Repository> >;
template class Sequence<RepositoryVirtualsEntry>;
template class Sequence<RepositoryProvidesEntry>;
+template class WrappedForwardIterator<RepositoryMirrorsInterface::MirrorsConstIteratorTag,
+ const std::pair<const std::string, std::string> >;
+template class WrappedForwardIterator<RepositoryEInterface::ProfilesConstIteratorTag, const RepositoryEInterface::ProfilesDescLine>;
+
NoSuchSetError::NoSuchSetError(const std::string & our_name) throw () :
Exception("Could not find '" + our_name + "'"),
_name(our_name)
diff --git a/paludis/repository.hh b/paludis/repository.hh
index 375f204..1c0cdef 100644
--- a/paludis/repository.hh
+++ b/paludis/repository.hh
@@ -33,11 +33,10 @@
#include <paludis/util/sr.hh>
#include <paludis/util/fs_entry.hh>
#include <paludis/util/virtual_constructor.hh>
+#include <paludis/util/wrapped_forward_iterator-fwd.hh>
#include <paludis/version_spec.hh>
#include <string>
-#include <libwrapiter/libwrapiter_forward_iterator-fwd.hh>
-
/** \file
* Declarations for Repository classes.
*
@@ -477,7 +476,7 @@ namespace paludis
///\name Iterate over our mirrors
///\{
- typedef libwrapiter::ForwardIterator<RepositoryMirrorsInterface,
+ typedef WrappedForwardIterator<enum MirrorsConstIteratorTag { },
const std::pair<const std::string, std::string> > MirrorsConstIterator;
virtual MirrorsConstIterator begin_mirrors(const std::string & s) const
@@ -644,8 +643,7 @@ namespace paludis
typedef RepositoryEInterfaceProfilesDescLine ProfilesDescLine;
- typedef libwrapiter::ForwardIterator<RepositoryEInterface,
- const ProfilesDescLine> ProfilesConstIterator;
+ typedef WrappedForwardIterator<enum ProfilesConstIteratorTag { }, const ProfilesDescLine> ProfilesConstIterator;
virtual ProfilesConstIterator begin_profiles() const = 0;
virtual ProfilesConstIterator end_profiles() const = 0;
diff --git a/paludis/repository_info.cc b/paludis/repository_info.cc
index c150187..c8abbc6 100644
--- a/paludis/repository_info.cc
+++ b/paludis/repository_info.cc
@@ -22,15 +22,19 @@
#include <paludis/repository_info.hh>
#include <paludis/util/private_implementation_pattern-impl.hh>
#include <paludis/util/instantiation_policy-impl.hh>
+#include <paludis/util/wrapped_forward_iterator-impl.hh>
#include <paludis/util/stringify.hh>
-#include <libwrapiter/libwrapiter_forward_iterator.hh>
-#include <libwrapiter/libwrapiter_output_iterator.hh>
#include <list>
#include <map>
#include <utility>
using namespace paludis;
+template class WrappedForwardIterator<RepositoryInfoSection::KeyValueConstIteratorTag,
+ const std::pair<const std::string, std::string> >;
+template class WrappedForwardIterator<RepositoryInfo::SectionConstIteratorTag,
+ const tr1::shared_ptr<const RepositoryInfoSection> >;
+
namespace paludis
{
template<>
diff --git a/paludis/repository_info.hh b/paludis/repository_info.hh
index c913764..02e6fe3 100644
--- a/paludis/repository_info.hh
+++ b/paludis/repository_info.hh
@@ -21,6 +21,7 @@
#define PALUDIS_GUARD_PALUDIS_REPOSITORY_INFO_HH 1
#include <paludis/repository_info-fwd.hh>
+#include <paludis/util/wrapped_forward_iterator-fwd.hh>
/** \file
* Declarations for RepositoryInfo classes.
@@ -61,7 +62,7 @@ namespace paludis
///\name Iterate over our key/values
///\{
- typedef libwrapiter::ForwardIterator<RepositoryInfoSection,
+ typedef WrappedForwardIterator<enum KeyValueConstIteratorTag { },
const std::pair<const std::string, std::string> > KeyValueConstIterator;
KeyValueConstIterator begin_kvs() const
@@ -100,7 +101,7 @@ namespace paludis
///\name ConstIterator over our sections
///\{
- typedef libwrapiter::ForwardIterator<RepositoryInfo,
+ typedef WrappedForwardIterator<enum SectionConstIteratorTag { },
const tr1::shared_ptr<const RepositoryInfoSection> > SectionConstIterator;
SectionConstIterator begin_sections() const
diff --git a/paludis/repository_name_cache.cc b/paludis/repository_name_cache.cc
index ea25335..28b9896 100644
--- a/paludis/repository_name_cache.cc
+++ b/paludis/repository_name_cache.cc
@@ -28,8 +28,8 @@
#include <paludis/util/dir_iterator.hh>
#include <paludis/util/private_implementation_pattern-impl.hh>
#include <paludis/util/mutex.hh>
-#include <libwrapiter/libwrapiter_forward_iterator.hh>
-#include <libwrapiter/libwrapiter_output_iterator.hh>
+#include <paludis/util/wrapped_forward_iterator.hh>
+#include <paludis/util/wrapped_output_iterator.hh>
#include <list>
#include <fstream>
diff --git a/paludis/repository_name_cache_TEST.cc b/paludis/repository_name_cache_TEST.cc
index 0092c32..1a3a962 100644
--- a/paludis/repository_name_cache_TEST.cc
+++ b/paludis/repository_name_cache_TEST.cc
@@ -22,10 +22,9 @@
#include <paludis/repositories/fake/fake_repository.hh>
#include <paludis/util/fs_entry.hh>
#include <paludis/util/join.hh>
+#include <paludis/util/wrapped_forward_iterator.hh>
#include <paludis/util/set.hh>
#include <paludis/package_database.hh>
-#include <libwrapiter/libwrapiter_forward_iterator.hh>
-#include <libwrapiter/libwrapiter_output_iterator.hh>
#include <test/test_framework.hh>
#include <test/test_runner.hh>
diff --git a/paludis/set_file.cc b/paludis/set_file.cc
index 8dc295e..366637e 100644
--- a/paludis/set_file.cc
+++ b/paludis/set_file.cc
@@ -31,8 +31,6 @@
#include <paludis/environment.hh>
#include <paludis/query.hh>
#include <paludis/package_database.hh>
-#include <libwrapiter/libwrapiter_forward_iterator.hh>
-#include <libwrapiter/libwrapiter_output_iterator.hh>
#include <list>
#include <vector>
#include <fstream>
diff --git a/paludis/set_file_TEST.cc b/paludis/set_file_TEST.cc
index 26a29ea..c03f54c 100644
--- a/paludis/set_file_TEST.cc
+++ b/paludis/set_file_TEST.cc
@@ -22,7 +22,6 @@
#include <test/test_framework.hh>
#include <paludis/util/fs_entry.hh>
#include <paludis/util/visitor-impl.hh>
-#include <libwrapiter/libwrapiter_forward_iterator.hh>
#include <fstream>
using namespace test;
diff --git a/paludis/show_suggest_visitor.cc b/paludis/show_suggest_visitor.cc
index 5c60377..72681cb 100644
--- a/paludis/show_suggest_visitor.cc
+++ b/paludis/show_suggest_visitor.cc
@@ -28,8 +28,6 @@
#include <paludis/util/save.hh>
#include <paludis/util/visitor-impl.hh>
#include <paludis/util/private_implementation_pattern-impl.hh>
-#include <libwrapiter/libwrapiter_forward_iterator.hh>
-#include <libwrapiter/libwrapiter_output_iterator.hh>
#include <set>
using namespace paludis;
diff --git a/paludis/stage_builder_task.cc b/paludis/stage_builder_task.cc
index 0990e38..243da10 100644
--- a/paludis/stage_builder_task.cc
+++ b/paludis/stage_builder_task.cc
@@ -21,11 +21,14 @@
#include <paludis/environment.hh>
#include <paludis/util/private_implementation_pattern-impl.hh>
-#include <libwrapiter/libwrapiter_forward_iterator.hh>
+#include <paludis/util/wrapped_forward_iterator-impl.hh>
#include <list>
using namespace paludis;
+template class WrappedForwardIterator<StageBuilderTask::StageConstIteratorTag,
+ const tr1::shared_ptr<const StageBase> >;
+
namespace paludis
{
template<>
diff --git a/paludis/stage_builder_task.hh b/paludis/stage_builder_task.hh
index dec7541..4a7e806 100644
--- a/paludis/stage_builder_task.hh
+++ b/paludis/stage_builder_task.hh
@@ -20,11 +20,10 @@
#ifndef PALUDIS_GUARD_PALUDIS_STAGE_BUILDER_TASK_HH
#define PALUDIS_GUARD_PALUDIS_STAGE_BUILDER_TASK_HH 1
-#include <libwrapiter/libwrapiter_forward_iterator-fwd.hh>
-
#include <paludis/util/instantiation_policy.hh>
#include <paludis/util/private_implementation_pattern.hh>
#include <paludis/util/exception.hh>
+#include <paludis/util/wrapped_forward_iterator-fwd.hh>
#include <paludis/util/tr1_memory.hh>
@@ -122,7 +121,7 @@ namespace paludis
///\name Iterate over our stages
///\{
- typedef libwrapiter::ForwardIterator<StageBuilderTask, const tr1::shared_ptr<const StageBase> > StageConstIterator;
+ typedef WrappedForwardIterator<enum StageConstIteratorTag { }, const tr1::shared_ptr<const StageBase> > StageConstIterator;
StageConstIterator begin_stages() const;
StageConstIterator end_stages() const;
diff --git a/paludis/stringify_formatter-impl.hh b/paludis/stringify_formatter-impl.hh
index ab71c29..de34207 100644
--- a/paludis/stringify_formatter-impl.hh
+++ b/paludis/stringify_formatter-impl.hh
@@ -175,36 +175,37 @@ namespace paludis
};
template <typename T_>
- StringifyFormatter::StringifyFormatter(const T_ & t) :
- PrivateImplementationPattern<StringifyFormatter>(new Implementation<StringifyFormatter>(
- StringifyFormatterGetForwarder<tr1::is_convertible<T_ *, CanFormat<std::string> *>::value, std::string>::get(&t),
- StringifyFormatterGetForwarder<tr1::is_convertible<T_ *, CanFormat<IUseFlag> *>::value, IUseFlag>::get(&t),
- StringifyFormatterGetForwarder<tr1::is_convertible<T_ *, CanFormat<UseFlagName> *>::value, UseFlagName>::get(&t),
- StringifyFormatterGetForwarder<tr1::is_convertible<T_ *, CanFormat<KeywordName> *>::value, KeywordName>::get(&t),
- StringifyFormatterGetForwarder<tr1::is_convertible<T_ *, CanFormat<PackageDepSpec> *>::value, PackageDepSpec>::get(&t),
- StringifyFormatterGetForwarder<tr1::is_convertible<T_ *, CanFormat<BlockDepSpec> *>::value, BlockDepSpec>::get(&t),
- StringifyFormatterGetForwarder<
- tr1::is_convertible<T_ *, CanFormat<FetchableURIDepSpec> *>::value,
- FetchableURIDepSpec>::get(&t),
- StringifyFormatterGetForwarder<
- tr1::is_convertible<T_ *, CanFormat<SimpleURIDepSpec> *>::value,
- SimpleURIDepSpec>::get(&t),
- StringifyFormatterGetForwarder<
- tr1::is_convertible<T_ *, CanFormat<LicenseDepSpec> *>::value,
- LicenseDepSpec>::get(&t),
- StringifyFormatterGetForwarder<
- tr1::is_convertible<T_ *, CanFormat<DependencyLabelsDepSpec> *>::value,
- DependencyLabelsDepSpec>::get(&t),
- StringifyFormatterGetForwarder<
- tr1::is_convertible<T_ *, CanFormat<URILabelsDepSpec> *>::value,
- URILabelsDepSpec>::get(&t),
- StringifyFormatterGetForwarder<
- tr1::is_convertible<T_ *, CanFormat<PlainTextDepSpec> *>::value,
- PlainTextDepSpec>::get(&t),
- StringifyFormatterGetForwarder<tr1::is_convertible<T_ *, CanFormat<UseDepSpec> *>::value, UseDepSpec>::get(&t),
- StringifyFormatterGetForwarder<tr1::is_convertible<T_ *, CanFormat<NamedSetDepSpec> *>::value, NamedSetDepSpec>::get(&t),
- StringifyFormatterGetSpaceForwarder<tr1::is_convertible<T_ *, CanSpace *>::value>::get(&t)
- ))
+ StringifyFormatter::StringifyFormatter(const T_ & t) :
+ PrivateImplementationPattern<StringifyFormatter>(new Implementation<StringifyFormatter>(
+ StringifyFormatterGetForwarder<tr1::is_convertible<T_ *, CanFormat<std::string> *>::value, std::string>::get(&t),
+ StringifyFormatterGetForwarder<tr1::is_convertible<T_ *, CanFormat<IUseFlag> *>::value, IUseFlag>::get(&t),
+ StringifyFormatterGetForwarder<tr1::is_convertible<T_ *, CanFormat<UseFlagName> *>::value, UseFlagName>::get(&t),
+ StringifyFormatterGetForwarder<tr1::is_convertible<T_ *, CanFormat<KeywordName> *>::value, KeywordName>::get(&t),
+ StringifyFormatterGetForwarder<tr1::is_convertible<T_ *, CanFormat<PackageDepSpec> *>::value, PackageDepSpec>::get(&t),
+ StringifyFormatterGetForwarder<tr1::is_convertible<T_ *, CanFormat<BlockDepSpec> *>::value, BlockDepSpec>::get(&t),
+ StringifyFormatterGetForwarder<
+ tr1::is_convertible<T_ *, CanFormat<FetchableURIDepSpec> *>::value,
+ FetchableURIDepSpec>::get(&t),
+ StringifyFormatterGetForwarder<
+ tr1::is_convertible<T_ *, CanFormat<SimpleURIDepSpec> *>::value,
+ SimpleURIDepSpec>::get(&t),
+ StringifyFormatterGetForwarder<
+ tr1::is_convertible<T_ *, CanFormat<LicenseDepSpec> *>::value,
+ LicenseDepSpec>::get(&t),
+ StringifyFormatterGetForwarder<
+ tr1::is_convertible<T_ *, CanFormat<DependencyLabelsDepSpec> *>::value,
+ DependencyLabelsDepSpec>::get(&t),
+ StringifyFormatterGetForwarder<
+ tr1::is_convertible<T_ *, CanFormat<URILabelsDepSpec> *>::value,
+ URILabelsDepSpec>::get(&t),
+ StringifyFormatterGetForwarder<
+ tr1::is_convertible<T_ *, CanFormat<PlainTextDepSpec> *>::value,
+ PlainTextDepSpec>::get(&t),
+ StringifyFormatterGetForwarder<tr1::is_convertible<T_ *, CanFormat<UseDepSpec> *>::value, UseDepSpec>::get(&t),
+ StringifyFormatterGetForwarder<tr1::is_convertible<T_ *, CanFormat<NamedSetDepSpec> *>::value, NamedSetDepSpec>::get(&t),
+ StringifyFormatterGetSpaceForwarder<tr1::is_convertible<T_ *, CanSpace *>::value>::get(&t)
+ )),
+ CanSpace()
{
}
}
diff --git a/paludis/sync_task.cc b/paludis/sync_task.cc
index 004d476..33a76f3 100644
--- a/paludis/sync_task.cc
+++ b/paludis/sync_task.cc
@@ -21,13 +21,15 @@
#include <paludis/environment.hh>
#include <paludis/syncer.hh>
#include <paludis/util/private_implementation_pattern-impl.hh>
+#include <paludis/util/wrapped_forward_iterator-impl.hh>
#include <paludis/package_database.hh>
#include <paludis/hook.hh>
-#include <libwrapiter/libwrapiter_forward_iterator.hh>
#include <list>
using namespace paludis;
+template class WrappedForwardIterator<SyncTask::TargetsConstIteratorTag, const RepositoryName>;
+
namespace paludis
{
template<>
diff --git a/paludis/sync_task.hh b/paludis/sync_task.hh
index 6670705..fb7d0cb 100644
--- a/paludis/sync_task.hh
+++ b/paludis/sync_task.hh
@@ -22,8 +22,8 @@
#include <paludis/util/instantiation_policy.hh>
#include <paludis/util/private_implementation_pattern.hh>
+#include <paludis/util/wrapped_forward_iterator-fwd.hh>
#include <paludis/dep_list.hh>
-#include <libwrapiter/libwrapiter_forward_iterator-fwd.hh>
/** \file
* Declarations for SyncTask.
@@ -89,7 +89,7 @@ namespace paludis
///\name Target iteration
///\{
- typedef libwrapiter::ForwardIterator<SyncTask, const RepositoryName> TargetsConstIterator;
+ typedef WrappedForwardIterator<enum TargetsConstIteratorTag { }, const RepositoryName> TargetsConstIterator;
TargetsConstIterator begin_targets() const;
TargetsConstIterator end_targets() const;
diff --git a/paludis/syncer.cc b/paludis/syncer.cc
index 75222a5..66b5ed0 100644
--- a/paludis/syncer.cc
+++ b/paludis/syncer.cc
@@ -26,9 +26,8 @@
#include <paludis/util/system.hh>
#include <paludis/util/tokeniser.hh>
#include <paludis/util/join.hh>
+#include <paludis/util/wrapped_forward_iterator.hh>
#include <paludis/util/sequence.hh>
-#include <libwrapiter/libwrapiter_forward_iterator.hh>
-#include <libwrapiter/libwrapiter_output_iterator.hh>
#include <list>
using namespace paludis;
diff --git a/paludis/uninstall_list.cc b/paludis/uninstall_list.cc
index 3643ee1..3b41b01 100644
--- a/paludis/uninstall_list.cc
+++ b/paludis/uninstall_list.cc
@@ -29,6 +29,8 @@
#include <paludis/util/private_implementation_pattern-impl.hh>
#include <paludis/util/make_shared_ptr.hh>
#include <paludis/util/mutex.hh>
+#include <paludis/util/wrapped_forward_iterator-impl.hh>
+#include <paludis/util/wrapped_output_iterator-impl.hh>
#include <paludis/hashed_containers.hh>
#include <paludis/match_package.hh>
#include <paludis/package_database.hh>
@@ -36,8 +38,6 @@
#include <paludis/query.hh>
#include <paludis/metadata_key.hh>
#include <paludis/dep_tag.hh>
-#include <libwrapiter/libwrapiter_forward_iterator.hh>
-#include <libwrapiter/libwrapiter_output_iterator.hh>
#include <list>
#include <algorithm>
#include <set>
@@ -50,6 +50,8 @@ using namespace paludis;
typedef MakeHashedMap<tr1::shared_ptr<const PackageID>, tr1::shared_ptr<const DepListEntryTags> >::Type DepCollectorCache;
template class Set<tr1::shared_ptr<DepTag> >;
+template class WrappedForwardIterator<Set<tr1::shared_ptr<DepTag> >::ConstIteratorTag, const tr1::shared_ptr<DepTag> >;
+template class WrappedOutputIterator<Set<tr1::shared_ptr<DepTag> >::InserterTag, tr1::shared_ptr<DepTag> >;
namespace paludis
{
diff --git a/paludis/uninstall_list.hh b/paludis/uninstall_list.hh
index 2ebcb5d..7c1e763 100644
--- a/paludis/uninstall_list.hh
+++ b/paludis/uninstall_list.hh
@@ -23,11 +23,10 @@
#include <paludis/util/instantiation_policy.hh>
#include <paludis/util/private_implementation_pattern.hh>
#include <paludis/util/sr.hh>
+#include <paludis/util/wrapped_forward_iterator-fwd.hh>
#include <paludis/package_id-fwd.hh>
#include <paludis/dep_tag-fwd.hh>
-#include <libwrapiter/libwrapiter_forward_iterator-fwd.hh>
-
/** \file
* Declarations for UninstallList and related classes.
*
@@ -105,7 +104,7 @@ namespace paludis
///\name Iterate over our items to remove
///\{
- typedef libwrapiter::ForwardIterator<UninstallList, const UninstallListEntry> ConstIterator;
+ typedef WrappedForwardIterator<enum UninstallListTag { }, const UninstallListEntry> ConstIterator;
ConstIterator begin() const;
ConstIterator end() const;
diff --git a/paludis/uninstall_list_TEST.cc b/paludis/uninstall_list_TEST.cc
index f62c46a..5d1c913 100644
--- a/paludis/uninstall_list_TEST.cc
+++ b/paludis/uninstall_list_TEST.cc
@@ -27,8 +27,6 @@
#include <paludis/package_database.hh>
#include <test/test_framework.hh>
#include <test/test_runner.hh>
-#include <libwrapiter/libwrapiter_forward_iterator.hh>
-#include <libwrapiter/libwrapiter_output_iterator.hh>
#include <string>
#include <list>
#include <ostream>
diff --git a/paludis/uninstall_task.cc b/paludis/uninstall_task.cc
index a147e9b..e819905 100644
--- a/paludis/uninstall_task.cc
+++ b/paludis/uninstall_task.cc
@@ -27,14 +27,14 @@
#include <paludis/util/private_implementation_pattern-impl.hh>
#include <paludis/util/stringify.hh>
#include <paludis/util/tr1_functional.hh>
+#include <paludis/util/iterator_funcs.hh>
#include <paludis/util/sequence.hh>
+#include <paludis/util/wrapped_forward_iterator-impl.hh>
#include <paludis/query.hh>
#include <paludis/package_database.hh>
#include <paludis/hook.hh>
#include <paludis/dep_tag.hh>
#include <paludis/repository.hh>
-#include <libwrapiter/libwrapiter_forward_iterator.hh>
-#include <libwrapiter/libwrapiter_output_iterator.hh>
#include <map>
#include <set>
#include <list>
@@ -43,6 +43,8 @@
using namespace paludis;
+template class WrappedForwardIterator<AmbiguousUnmergeTargetError::ConstIteratorTag, const tr1::shared_ptr<const PackageID> >;
+
AmbiguousUnmergeTargetError::AmbiguousUnmergeTargetError(const std::string & t,
const tr1::shared_ptr<const PackageIDSequence> m) throw () :
Exception("Ambiguous unmerge target '" + t + "'"),
diff --git a/paludis/uninstall_task.hh b/paludis/uninstall_task.hh
index a89df25..c7f119f 100644
--- a/paludis/uninstall_task.hh
+++ b/paludis/uninstall_task.hh
@@ -26,7 +26,7 @@
#include <paludis/util/instantiation_policy.hh>
#include <paludis/util/private_implementation_pattern.hh>
#include <paludis/util/exception.hh>
-#include <libwrapiter/libwrapiter_forward_iterator.hh>
+#include <paludis/util/wrapped_forward_iterator-fwd.hh>
/** \file
* Declarations for UninstallTask.
@@ -70,7 +70,7 @@ namespace paludis
///\name Iterate over our entries
///\{
- typedef libwrapiter::ForwardIterator<AmbiguousUnmergeTargetError, const tr1::shared_ptr<const PackageID> > ConstIterator;
+ typedef WrappedForwardIterator<enum ConstIteratorTag { }, const tr1::shared_ptr<const PackageID> > ConstIterator;
ConstIterator begin() const;
ConstIterator end() const;
diff --git a/paludis/util/config_file.cc b/paludis/util/config_file.cc
index 058e8af..06c850f 100644
--- a/paludis/util/config_file.cc
+++ b/paludis/util/config_file.cc
@@ -29,8 +29,8 @@
#include <paludis/util/join.hh>
#include <paludis/util/private_implementation_pattern-impl.hh>
#include <paludis/util/map.hh>
+#include <paludis/util/wrapped_forward_iterator-impl.hh>
-#include <libwrapiter/libwrapiter_forward_iterator.hh>
#include <fstream>
#include <istream>
#include <list>
@@ -41,6 +41,12 @@ using namespace paludis;
#include <paludis/util/config_file-se.cc>
+template class WrappedForwardIterator<LineConfigFile::ConstIteratorTag, const std::string>;
+template class WrappedForwardIterator<KeyValueConfigFile::Defaults::ConstIteratorTag,
+ const std::pair<const std::string, std::string> >;
+template class WrappedForwardIterator<KeyValueConfigFile::ConstIteratorTag,
+ const std::pair<const std::string, std::string> >;
+
ConfigFileError::ConfigFileError(const std::string & f, const std::string & m) throw () :
ConfigurationError("Configuration file error: " + (f.empty() ? m : f + ": " + m))
{
diff --git a/paludis/util/config_file.hh b/paludis/util/config_file.hh
index 730f504..fa8a8c7 100644
--- a/paludis/util/config_file.hh
+++ b/paludis/util/config_file.hh
@@ -25,8 +25,7 @@
#include <paludis/util/instantiation_policy.hh>
#include <paludis/util/private_implementation_pattern.hh>
#include <paludis/util/options-fwd.hh>
-
-#include <libwrapiter/libwrapiter_forward_iterator-fwd.hh>
+#include <paludis/util/wrapped_forward_iterator-fwd.hh>
#include <iosfwd>
#include <string>
@@ -199,7 +198,7 @@ namespace paludis
///\name Iterate over our lines
///\{
- typedef libwrapiter::ForwardIterator<LineConfigFile, const std::string> ConstIterator;
+ typedef WrappedForwardIterator<enum ConstIteratorTag { }, const std::string> ConstIterator;
ConstIterator begin() const PALUDIS_ATTRIBUTE((warn_unused_result));
ConstIterator end() const PALUDIS_ATTRIBUTE((warn_unused_result));
@@ -290,7 +289,8 @@ namespace paludis
///\name Iterate over our default keys
///\{
- typedef libwrapiter::ForwardIterator<Defaults, const std::pair<const std::string, std::string> > ConstIterator;
+ typedef WrappedForwardIterator<enum ConstIteratorTag { },
+ const std::pair<const std::string, std::string> > ConstIterator;
ConstIterator begin() const PALUDIS_ATTRIBUTE((warn_unused_result));
ConstIterator end() const PALUDIS_ATTRIBUTE((warn_unused_result));
@@ -322,7 +322,8 @@ namespace paludis
///\name Iterate over our keys
///\{
- typedef libwrapiter::ForwardIterator<KeyValueConfigFile, const std::pair<const std::string, std::string> > ConstIterator;
+ typedef WrappedForwardIterator<enum ConstIteratorTag { },
+ const std::pair<const std::string, std::string> > ConstIterator;
ConstIterator begin() const PALUDIS_ATTRIBUTE((warn_unused_result));
ConstIterator end() const PALUDIS_ATTRIBUTE((warn_unused_result));
diff --git a/paludis/util/config_file_TEST.cc b/paludis/util/config_file_TEST.cc
index 4c23497..162483c 100644
--- a/paludis/util/config_file_TEST.cc
+++ b/paludis/util/config_file_TEST.cc
@@ -23,8 +23,7 @@
#include <paludis/util/system.hh>
#include <paludis/util/map.hh>
#include <paludis/util/options.hh>
-#include <libwrapiter/libwrapiter_forward_iterator.hh>
-#include <libwrapiter/libwrapiter_output_iterator.hh>
+#include <paludis/util/wrapped_forward_iterator.hh>
#include <sstream>
#include <test/test_framework.hh>
#include <test/test_runner.hh>
diff --git a/paludis/util/destringify_TEST.cc b/paludis/util/destringify_TEST.cc
index ca968bc..c790637 100644
--- a/paludis/util/destringify_TEST.cc
+++ b/paludis/util/destringify_TEST.cc
@@ -64,10 +64,10 @@ namespace test_cases
void run()
{
- TEST_CHECK_EQUAL(destringify<float>("0"), 0.f);
- TEST_CHECK_EQUAL(destringify<float>("0.0"), 0.f);
- TEST_CHECK_EQUAL(destringify<float>("0.1"), 0.1f);
- TEST_CHECK_EQUAL(destringify<float>("-1.54"), -1.54f);
+ TEST_CHECK(abs(destringify<float>("0") - 0.0f) < 0.01f);
+ TEST_CHECK(abs(destringify<float>("0.0") - 0.0f) < 0.01f);
+ TEST_CHECK(abs(destringify<float>("0.1") - 0.1f) < 0.01f);
+ TEST_CHECK(abs(destringify<float>("-1.54") - -1.54f) < 0.01f);
TEST_CHECK_THROWS(destringify<float>("I am a fish"), DestringifyError);
TEST_CHECK_THROWS(destringify<float>(""), DestringifyError);
}
diff --git a/paludis/util/dir_iterator.cc b/paludis/util/dir_iterator.cc
index c9b57cd..9864864 100644
--- a/paludis/util/dir_iterator.cc
+++ b/paludis/util/dir_iterator.cc
@@ -98,7 +98,7 @@ DirIterator::~DirIterator()
{
}
-const DirIterator &
+DirIterator &
DirIterator::operator= (const DirIterator & other)
{
if (this != &other)
diff --git a/paludis/util/dir_iterator.hh b/paludis/util/dir_iterator.hh
index f228ae4..f95579f 100644
--- a/paludis/util/dir_iterator.hh
+++ b/paludis/util/dir_iterator.hh
@@ -24,6 +24,10 @@
#include <paludis/util/fs_entry.hh>
#include <paludis/util/private_implementation_pattern.hh>
+#ifdef PALUDIS_HAVE_CONCEPTS
+# include <concepts>
+#endif
+
/** \file
* Declarations for DirIterator.
*
@@ -62,10 +66,20 @@ namespace paludis
* \nosubgrouping
*/
class PALUDIS_VISIBLE DirIterator :
- public std::iterator<std::forward_iterator_tag, FSEntry>,
private PrivateImplementationPattern<DirIterator>
{
public:
+ ///\name Standard library typedefs
+ ///\{
+
+ typedef FSEntry value_type;
+ typedef const FSEntry & reference;
+ typedef const FSEntry * pointer;
+ typedef std::ptrdiff_t difference_type;
+ typedef std::forward_iterator_tag iterator_category;
+
+ ///\}
+
///\name Basic operations
///\{
@@ -84,7 +98,7 @@ namespace paludis
~DirIterator();
- const DirIterator & operator= (const DirIterator & other);
+ DirIterator & operator= (const DirIterator & other);
///\}
@@ -119,4 +133,13 @@ namespace paludis
};
}
+#ifdef PALUDIS_HAVE_CONCEPTS
+namespace std
+{
+ concept_map ForwardIterator<paludis::DirIterator>
+ {
+ };
+}
+#endif
+
#endif
diff --git a/paludis/util/exception.cc b/paludis/util/exception.cc
index 8fa85a3..d66a31d 100644
--- a/paludis/util/exception.cc
+++ b/paludis/util/exception.cc
@@ -19,11 +19,9 @@
#include <paludis/util/exception.hh>
#include <paludis/util/stringify.hh>
-#include <libebt/libebt.hh>
-
-#ifdef PALUDIS_ENABLE_THREADS
-# include <libebt/libebt_pthread_threads.hh>
-#endif
+#include <paludis/util/join.hh>
+#include <paludis/util/tr1_memory.hh>
+#include <list>
#include "config.h"
@@ -35,55 +33,58 @@ using namespace paludis;
namespace
{
- struct ContextTag;
+ PALUDIS_TLS std::list<std::string> * context = 0;
}
-#ifdef PALUDIS_ENABLE_THREADS
-
-namespace libebt
+Context::Context(const std::string & s)
{
- template <>
- struct BacktraceContextHolder<ContextTag> :
- PthreadBacktraceContextHolder<ContextTag>
- {
- };
+ if (! context)
+ context = new std::list<std::string>;
+ context->push_back(s);
}
-#endif
-
-struct Context::ContextData
+Context::~Context()
{
- libebt::BacktraceContext<ContextTag> context;
-
- ContextData(const std::string & s) :
- context(s)
+ if (! context)
+ throw InternalError(PALUDIS_HERE, "no context");
+ context->pop_back();
+ if (context->empty())
{
+ delete context;
+ context = 0;
}
-};
-
-Context::Context(const std::string & s) :
- _context_data(new ContextData(s))
-{
-}
-
-Context::~Context()
-{
- delete _context_data;
}
std::string
Context::backtrace(const std::string & delim)
{
- return libebt::BacktraceContext<ContextTag>::backtrace(delim);
+ if (! context)
+ return "";
+
+ return join(context->begin(), context->end(), delim);
}
-struct Exception::ContextData :
- public libebt::Backtraceable<ContextTag>
+namespace paludis
{
-};
+ struct Exception::ContextData
+ {
+ std::list<std::string> local_context;
-Exception::Exception(const std::string & our_message) throw () :
- _message(our_message),
+ ContextData()
+ {
+ if (context)
+ local_context.assign(context->begin(), context->end());
+ }
+
+ ContextData(const ContextData & other) :
+ local_context(other.local_context)
+ {
+ }
+ };
+}
+
+Exception::Exception(const std::string & m) throw () :
+ _message(m),
_context_data(new ContextData)
{
}
@@ -100,12 +101,6 @@ Exception::~Exception() throw ()
delete _context_data;
}
-bool
-Exception::empty() const
-{
- return _context_data->empty();
-}
-
const std::string &
Exception::message() const throw ()
{
@@ -115,7 +110,13 @@ Exception::message() const throw ()
std::string
Exception::backtrace(const std::string & delim) const
{
- return _context_data->backtrace(delim);
+ return join(_context_data->local_context.begin(), _context_data->local_context.end(), delim);
+}
+
+bool
+Exception::empty() const
+{
+ return _context_data->local_context.empty();
}
NotAvailableError::NotAvailableError(const std::string & msg) throw () :
diff --git a/paludis/util/exception.hh b/paludis/util/exception.hh
index 96779b9..f45c7ba 100644
--- a/paludis/util/exception.hh
+++ b/paludis/util/exception.hh
@@ -24,7 +24,6 @@
#include <string>
#include <exception>
-
/** \file
* Declaration for the Exception base class, the InternalError exception
* class, the NameError class and related utilities.
@@ -50,9 +49,6 @@ namespace paludis
Context(const Context &);
const Context & operator= (const Context &);
- struct ContextData;
- ContextData * const _context_data;
-
public:
///\name Basic operations
///\{
@@ -64,7 +60,7 @@ namespace paludis
///\}
/**
- * Current context (forwards to libebt).
+ * Current context.
*/
static std::string backtrace(const std::string & delim);
};
diff --git a/paludis/util/fast_unique_copy.hh b/paludis/util/fast_unique_copy.hh
index 80dc0e0..796c2e0 100644
--- a/paludis/util/fast_unique_copy.hh
+++ b/paludis/util/fast_unique_copy.hh
@@ -1,7 +1,7 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
/*
- * Copyright (c) 2006 Ciaran McCreesh
+ * Copyright (c) 2006, 2007 Ciaran McCreesh
*
* 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
@@ -20,7 +20,7 @@
#ifndef PALUDIS_GUARD_PALUDIS_REPOSITORIES_VIRTUALS_FAST_UNIQUE_COPY_HH
#define PALUDIS_GUARD_PALUDIS_REPOSITORIES_VIRTUALS_FAST_UNIQUE_COPY_HH 1
-#include <paludis/util/iterator.hh>
+#include <paludis/util/iterator_funcs.hh>
#include <functional>
namespace paludis
diff --git a/paludis/util/files.m4 b/paludis/util/files.m4
index c861eb3..e4926c2 100644
--- a/paludis/util/files.m4
+++ b/paludis/util/files.m4
@@ -13,6 +13,7 @@ add(`attributes', `hh')
add(`config_file', `hh', `cc', `se', `test', `testscript')
add(`clone', `hh', `impl')
add(`condition_variable', `hh', `cc', `test')
+add(`create_iterator', `hh', `fwd', `impl')
add(`damerau_levenshtein', `hh', `cc', `test')
add(`destringify', `hh', `cc', `test')
add(`dir_iterator', `hh', `cc', `test', `testscript')
@@ -23,13 +24,15 @@ add(`future', `hh', `impl', `cc', `test')
add(`fs_entry', `hh', `cc', `fwd', `test', `testscript')
add(`fd_holder', `hh')
add(`graph', `hh', `cc', `fwd', `impl', `test')
-add(`iterator', `hh', `test')
+add(`iterator_funcs', `hh', `test')
+add(`indirect_iterator', `hh', `fwd', `impl', `test')
add(`instantiation_policy', `hh', `impl', `test')
add(`is_file_with_extension', `hh', `cc', `se', `test', `testscript')
add(`join', `hh', `test')
add(`log', `hh', `cc', `se', `test')
add(`make_shared_ptr', `hh', `fwd')
add(`map', `hh', `fwd', `impl', `cc')
+add(`member_iterator', `hh', `fwd', `impl', `test')
add(`mutex', `hh', `cc', `test')
add(`no_type', `hh')
add(`operators', `hh')
@@ -58,4 +61,6 @@ add(`validated', `hh', `fwd', `test')
add(`virtual_constructor', `hh', `impl', `test')
add(`visitor', `hh', `impl', `fwd', `test')
add(`visitor_cast', `hh', `test')
+add(`wrapped_forward_iterator', `hh', `fwd', `impl')
+add(`wrapped_output_iterator', `hh', `fwd', `impl')
diff --git a/paludis/util/fs_entry.cc b/paludis/util/fs_entry.cc
index 8abdba9..8e04c4c 100644
--- a/paludis/util/fs_entry.cc
+++ b/paludis/util/fs_entry.cc
@@ -26,6 +26,10 @@
#include <paludis/util/sequence-impl.hh>
#include <paludis/util/set.hh>
#include <paludis/util/set-impl.hh>
+#include <paludis/util/wrapped_forward_iterator.hh>
+#include <paludis/util/wrapped_forward_iterator-impl.hh>
+#include <paludis/util/wrapped_output_iterator.hh>
+#include <paludis/util/wrapped_output_iterator-impl.hh>
#include <sys/stat.h>
#include <sys/types.h>
@@ -46,6 +50,9 @@
using namespace paludis;
template class Sequence<FSEntry>;
+template class WrappedForwardIterator<Sequence<FSEntry>::ConstIteratorTag, const FSEntry>;
+template class WrappedForwardIterator<Sequence<FSEntry>::ReverseConstIteratorTag, const FSEntry>;
+template class WrappedOutputIterator<Sequence<FSEntry>::InserterTag, FSEntry>;
template class Set<FSEntry>;
FSError::FSError(const std::string & our_message) throw () :
diff --git a/paludis/util/graph-impl.hh b/paludis/util/graph-impl.hh
index e644dfe..237d0d6 100644
--- a/paludis/util/graph-impl.hh
+++ b/paludis/util/graph-impl.hh
@@ -22,7 +22,7 @@
#include <paludis/util/graph.hh>
#include <paludis/util/private_implementation_pattern-impl.hh>
-#include <libwrapiter/libwrapiter_forward_iterator.hh>
+#include <paludis/util/wrapped_forward_iterator-impl.hh>
#include <map>
#include <set>
#include <list>
@@ -60,7 +60,7 @@ namespace paludis
///\name Iterate over our nodes
///\{
- typedef libwrapiter::ForwardIterator<RemainingNodes, const std::string> ConstIterator;
+ typedef WrappedForwardIterator<enum ConstIteratorTag { }, const std::string> ConstIterator;
ConstIterator begin() const
{
diff --git a/paludis/util/iterator.hh b/paludis/util/iterator.hh
deleted file mode 100644
index a1cd793..0000000
--- a/paludis/util/iterator.hh
+++ /dev/null
@@ -1,573 +0,0 @@
-/* vim: set sw=4 sts=4 et foldmethod=syntax : */
-
-/*
- * Copyright (c) 2005, 2006, 2007 Ciaran McCreesh
- * Copyright (c) 2007 David Leverton
- *
- * 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 version 2, as published by the Free Software Foundation.
- *
- * 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_INDIRECT_ITERATOR_HH
-#define PALUDIS_GUARD_PALUDIS_INDIRECT_ITERATOR_HH 1
-
-#include <paludis/util/instantiation_policy.hh>
-#include <paludis/util/operators.hh>
-
-#include <iterator>
-#include <functional>
-#include <paludis/util/tr1_type_traits.hh>
-#include <paludis/util/tr1_memory.hh>
-
-/** \file
- * Declarations for various iterator helpers.
- *
- * \ingroup g_iterator
- *
- * \section Examples
- *
- * - None at this time.
- */
-
-namespace paludis
-{
- /**
- * Return a new iterator pointing to the item after i.
- *
- * \ingroup g_iterator
- */
- template <typename T_>
- T_ next(const T_ & i)
- {
- T_ result(i);
- return ++result;
- }
-
- /**
- * Return a new iterator advanced by a distance of n.
- *
- * \ingroup g_iterator
- */
- template <typename T_>
- T_ next(const T_ & i, const int & n)
- {
- T_ result(i);
- std::advance(result, n);
- return result;
- }
-
- /**
- * Return a new iterator pointing to the item before i.
- *
- * \ingroup g_iterator
- */
- template <typename T_>
- T_ previous(const T_ & i)
- {
- T_ result(i);
- return --result;
- }
-
- /**
- * Like tr1::remove_pointer, for tr1::shared_ptr.
- *
- * \ingroup g_iterator
- */
- template <typename T_>
- struct RemoveSharedPointer
- {
- /// Our type, with tr1::shared_ptr removed.
- typedef T_ Type;
- };
-
- /**
- * Like tr1::remove_pointer, for tr1::shared_ptr.
- *
- * \ingroup g_iterator
- */
- template <typename T_>
- struct RemoveSharedPointer<tr1::shared_ptr<T_> >
- {
- /// Our type, with tr1::shared_ptr removed.
- typedef T_ Type;
- };
-
- /**
- * Like tr1::remove_pointer, for tr1::shared_ptr.
- *
- * \ingroup g_iterator
- */
- template <typename T_>
- struct RemoveSharedPointer<const tr1::shared_ptr<T_> >
- {
- /// Our type, with tr1::shared_ptr removed.
- typedef T_ Type;
- };
-
- template <typename Iter_, typename Value_ =
- typename RemoveSharedPointer<typename tr1::remove_pointer<typename Iter_::value_type>::type>::Type>
- class IndirectIterator;
-
- /**
- * An IndirectIterator is an iterator adapter that does one additional level
- * of dereferencing.
- *
- * \ingroup g_iterator
- * \nosubgrouping
- */
- template <typename Iter_, typename Value_>
- class IndirectIterator :
- public std::iterator<typename std::iterator_traits<Iter_>::iterator_category, Value_>,
- public relational_operators::HasRelationalOperators
- {
- template <typename A_, typename B_> friend bool operator< (
- const IndirectIterator<A_, B_> &, const IndirectIterator<A_, B_> &);
-
- template <typename A_, typename B_> friend bool operator== (
- const IndirectIterator<A_, B_> &, const IndirectIterator<A_, B_> &);
-
- private:
- Iter_ _i;
-
- public:
- ///\name Basic operations
- ///\{
-
- IndirectIterator(const Iter_ & i) :
- _i(i)
- {
- }
-
- IndirectIterator(const IndirectIterator & other) :
- _i(other._i)
- {
- }
-
- const IndirectIterator & operator= (const IndirectIterator & other)
- {
- _i = other._i;
- return *this;
- }
-
- ///\}
-
- ///\name Dereference operators
- ///\{
-
- Value_ & operator*() const
- {
- return **_i;
- }
-
- Value_ * operator->() const
- {
- return &**_i;
- }
-
- ///\}
-
- ///\name Increment, decrement operators
- ///\{
-
- IndirectIterator & operator++ ()
- {
- ++_i;
- return *this;
- }
-
- IndirectIterator operator++ (int)
- {
- IndirectIterator tmp(*this);
- ++_i;
- return tmp;
- }
-
- ///\}
- };
-
- template <typename Iter_, typename Value_>
- bool operator< (const IndirectIterator<Iter_, Value_> & a, const IndirectIterator<Iter_, Value_> & b)
- {
- return a._i < b._i;
- }
-
- template <typename Iter_, typename Value_>
- bool operator== (const IndirectIterator<Iter_, Value_> & a, const IndirectIterator<Iter_, Value_> & b)
- {
- return a._i == b._i;
- }
-
- /**
- * Convenience constructor for an IndirectIterator.
- *
- * \ingroup g_iterator
- */
- template <typename Iter_>
- IndirectIterator<Iter_,
- typename RemoveSharedPointer<typename tr1::remove_pointer<typename Iter_::value_type>::type>::Type>
- indirect_iterator(const Iter_ & i)
- {
- return IndirectIterator<Iter_,
- typename RemoveSharedPointer<typename tr1::remove_pointer<typename Iter_::value_type>::type>::Type>(i);
- }
-
- /**
- * A FilterInsertIterator is an insert iterator that only performs an insert
- * if a particular predicate function returns true for the object to be
- * inserted.
- *
- * \ingroup g_iterator
- * \nosubgrouping
- */
- template <typename Iter_, typename Pred_>
- class FilterInsertIterator :
- public std::iterator<typename std::iterator_traits<Iter_>::iterator_category, void, void, void, void>
- {
- private:
- Iter_ _i;
- Pred_ _p;
-
- public:
- /**
- * Fake a container_type for use with other iterator adapters.
- */
- typedef typename Iter_::container_type container_type;
-
- ///\name Basic operations
- ///\{
-
- FilterInsertIterator(const Iter_ & i, const Pred_ & p) :
- _i(i),
- _p(p)
- {
- }
-
- FilterInsertIterator(const FilterInsertIterator & other) :
- _i(other._i),
- _p(other._p)
- {
- }
-
- template <typename T_>
- const FilterInsertIterator & operator= (const T_ value)
- {
- if (_p(value))
- *_i = value;
- return *this;
- }
-
- ~FilterInsertIterator();
-
- ///
-
- ///\name Dereference operators
- ///\{
-
- FilterInsertIterator & operator* ()
- {
- return *this;
- }
-
- FilterInsertIterator * operator-> ()
- {
- return this;
- }
-
- ///\}
-
- ///\name Increment, decrement operators
- ///\{
-
- FilterInsertIterator & operator++ ()
- {
- return *this;
- }
-
- FilterInsertIterator & operator++ (int)
- {
- return *this;
- }
-
- ///\}
- };
-
- template <typename Iter_, typename Pred_>
- FilterInsertIterator<Iter_, Pred_>::~FilterInsertIterator()
- {
- }
-
- /**
- * Convenience function: make a FilterInsertIterator.
- *
- * \ingroup g_iterator
- */
- template <typename Iter_, typename Pred_>
- FilterInsertIterator<Iter_, Pred_> filter_inserter(
- const Iter_ & i, const Pred_ & p)
- {
- return FilterInsertIterator<Iter_, Pred_>(i, p);
- }
-
- /**
- * A TransformInsertIterator is an insert iterator that calls some function
- * upon an item before inserting it.
- *
- * \ingroup g_iterator
- * \nosubgrouping
- */
- template <typename Iter_, typename Trans_>
- class TransformInsertIterator :
- public std::iterator<typename std::iterator_traits<Iter_>::iterator_category, void, void, void, void>
- {
- private:
- Iter_ _i;
- Trans_ _t;
-
- public:
- /**
- * Fake a container_type entry to allow a TransformInsertIterator to
- * work with other iterator adapters.
- */
- struct container_type
- {
- /// Our value type.
- typedef typename Trans_::argument_type value_type;
- };
-
- ///\name Basic operations
- ///\{
- TransformInsertIterator(const Iter_ & i, const Trans_ & t = Trans_()) :
- _i(i),
- _t(t)
- {
- }
-
- TransformInsertIterator(const TransformInsertIterator & other) :
- _i(other._i),
- _t(other._t)
- {
- }
-
- template <typename T_>
- const TransformInsertIterator & operator= (const T_ value)
- {
- *_i = _t(value);
- return *this;
- }
-
- ///\}
-
- ///\name Dereference operators
- ///\{
-
- TransformInsertIterator & operator* ()
- {
- return *this;
- }
-
- TransformInsertIterator * operator-> ()
- {
- return this;
- }
-
- ///\}
-
- ///\name Increment, decrement operators
- ///\{
-
- TransformInsertIterator & operator++ ()
- {
- return *this;
- }
-
- TransformInsertIterator & operator++ (int)
- {
- return *this;
- }
-
- ///\}
-
- };
-
- /**
- * Convenience function: make a TransformInsertIterator.
- *
- * \ingroup g_iterator
- */
- template <typename Iter_, typename Trans_>
- TransformInsertIterator<Iter_, Trans_> transform_inserter(
- const Iter_ & i, const Trans_ & t)
- {
- return TransformInsertIterator<Iter_, Trans_>(i, t);
- }
-
- /**
- * A CreateInsertIterator is an insert iterator that creates an object of
- * the specified type using the provided value.
- *
- * \ingroup g_iterator
- * \nosubgrouping
- */
- template <typename Iter_, typename Type_>
- class CreateInsertIterator :
- public std::iterator<typename std::iterator_traits<Iter_>::iterator_category, void, void, void, void>
- {
- private:
- Iter_ _i;
-
- public:
- /**
- * Fake a container_type to allow us to work with other iterator
- * adapters.
- */
- struct container_type
- {
- /// Our faked item type.
- typedef Type_ value_type;
- };
-
- ///\name Basic operations
- ///\{
-
- CreateInsertIterator(const Iter_ & i) :
- _i(i)
- {
- }
-
- CreateInsertIterator(const CreateInsertIterator & other) :
- _i(other._i)
- {
- }
-
- template <typename T_>
- const CreateInsertIterator & operator= (const T_ value)
- {
- *_i = Type_(value);
- return *this;
- }
-
- ///\}
-
- ///\name Dereference operators
- ///\{
-
- CreateInsertIterator & operator* ()
- {
- return *this;
- }
-
- CreateInsertIterator * operator-> ()
- {
- return this;
- }
-
- ///\}
-
- ///\name Increment, decrement operators
- ///\{
-
- CreateInsertIterator & operator++ ()
- {
- return *this;
- }
-
- CreateInsertIterator & operator++ (int)
- {
- return *this;
- }
-
- ///\}
- };
-
- /**
- * Convenience function: make a CreateInsertIterator.
- *
- * \ingroup g_iterator
- */
- template <typename Type_, typename Iter_>
- CreateInsertIterator<Iter_, Type_> create_inserter(const Iter_ & i)
- {
- return CreateInsertIterator<Iter_, Type_>(i);
- }
-
- template <typename Value_, typename Iterator_, Value_ std::iterator_traits<Iterator_>::value_type::* member_>
- class MemberIterator :
- public std::iterator<std::forward_iterator_tag, const Value_>,
- public paludis::equality_operators::HasEqualityOperators
- {
- private:
- Iterator_ _it;
-
- public:
- MemberIterator(Iterator_ it) :
- _it(it)
- {
- }
-
- bool operator== (const MemberIterator & other) const
- {
- return _it == other._it;
- }
-
- MemberIterator & operator++ ()
- {
- ++_it;
- return *this;
- }
-
- MemberIterator operator++ (int)
- {
- return MemberIterator(_it++);
- }
-
- typename std::iterator_traits<MemberIterator>::reference operator* () const
- {
- return (*_it).*member_;
- }
-
- typename std::iterator_traits<MemberIterator>::pointer operator-> () const
- {
- return &((*_it).*member_);
- }
- };
-
- template <typename Iterator_>
- struct FirstIterator
- {
- typedef MemberIterator<typename std::iterator_traits<Iterator_>::value_type::first_type,
- Iterator_, &std::iterator_traits<Iterator_>::value_type::first> Type;
- };
-
- template <typename Iterator_>
- inline typename FirstIterator<Iterator_>::Type
- first_iterator(Iterator_ it)
- {
- return typename FirstIterator<Iterator_>::Type(it);
- }
-
- template <typename Iterator_>
- struct SecondIterator
- {
- typedef MemberIterator<typename std::iterator_traits<Iterator_>::value_type::second_type,
- Iterator_, &std::iterator_traits<Iterator_>::value_type::second> Type;
- };
-
- template <typename Iterator_>
- inline typename SecondIterator<Iterator_>::Type
- second_iterator(Iterator_ it)
- {
- return typename SecondIterator<Iterator_>::Type(it);
- }
-}
-
-#endif
diff --git a/paludis/util/iterator_TEST.cc b/paludis/util/iterator_TEST.cc
deleted file mode 100644
index d012c03..0000000
--- a/paludis/util/iterator_TEST.cc
+++ /dev/null
@@ -1,439 +0,0 @@
-/* vim: set sw=4 sts=4 et foldmethod=syntax : */
-
-/*
- * Copyright (c) 2005, 2006, 2007 Ciaran McCreesh
- * Copyright (c) 2007 David Leverton
- *
- * 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 version 2, as published by the Free Software Foundation.
- *
- * 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
- */
-
-#include <algorithm>
-#include <list>
-#include <paludis/util/iterator.hh>
-#include <paludis/util/join.hh>
-#include <test/test_framework.hh>
-#include <test/test_runner.hh>
-#include <vector>
-#include <set>
-#include <map>
-#include <string>
-#include <paludis/util/tr1_memory.hh>
-
-using namespace test;
-using namespace paludis;
-
-/** \file
- * Test cases for iterator utilities.
- *
- */
-
-namespace
-{
- class Deleter
- {
- public:
- /**
- * Constructor.
- */
- Deleter()
- {
- }
-
- /**
- * Delete an item.
- */
- template <typename T_>
- void operator() (T_ t)
- {
- delete t;
- }
- };
-}
-
-namespace test_cases
-{
- /**
- * \test Test IndirectIterator over a vector of shared_ptr of int.
- *
- */
- struct IndirectIteratorVecCPIntTest : TestCase
- {
- IndirectIteratorVecCPIntTest() : TestCase("vector<tr1::shared_ptr<int> >") { }
-
- void run()
- {
- std::vector<tr1::shared_ptr<int> > v;
- v.push_back(tr1::shared_ptr<int>(new int(5)));
- v.push_back(tr1::shared_ptr<int>(new int(10)));
- IndirectIterator<std::vector<tr1::shared_ptr<int> >::iterator, int> vi(v.begin()), vi_end(v.end());
- TEST_CHECK(vi != vi_end);
- TEST_CHECK(vi < vi_end);
- TEST_CHECK(! (vi > vi_end));
- TEST_CHECK_EQUAL(*vi, 5);
- TEST_CHECK(++vi != vi_end);
- TEST_CHECK(vi < vi_end);
- TEST_CHECK(! (vi > vi_end));
- TEST_CHECK_EQUAL(*vi, 10);
- TEST_CHECK(++vi == vi_end);
- }
- } test_indirect_iterator_vec_cp_int;
-
- /**
- * \test Test IndirectIterator over a list of shared_ptr of int.
- *
- */
- struct IndirectIteratorListCPIntTest : TestCase
- {
- IndirectIteratorListCPIntTest() : TestCase("list<tr1::shared_ptr<int> >") { }
-
- void run()
- {
- std::list<tr1::shared_ptr<int> > v;
- v.push_back(tr1::shared_ptr<int>(new int(5)));
- v.push_back(tr1::shared_ptr<int>(new int(10)));
- IndirectIterator<std::list<tr1::shared_ptr<int> >::iterator> vi(v.begin()), vi_end(v.end());
- TEST_CHECK(vi != vi_end);
- TEST_CHECK_EQUAL(*vi, 5);
- TEST_CHECK(++vi != vi_end);
- TEST_CHECK_EQUAL(*vi, 10);
- TEST_CHECK(++vi == vi_end);
- }
- } test_indirect_iterator_list_cp_int;
-
- /**
- * \test Test IndirectIterator over a vector of int *.
- *
- */
- struct IndirectIteratorVecPIntTest : TestCase
- {
- IndirectIteratorVecPIntTest() : TestCase("vector<int *>") { }
-
- void run()
- {
- std::vector<int *> v;
- v.push_back(new int(5));
- v.push_back(new int(10));
- IndirectIterator<std::vector<int *>::iterator, int> vi(v.begin()), vi_end(v.end());
- TEST_CHECK(vi != vi_end);
- TEST_CHECK(vi < vi_end);
- TEST_CHECK(! (vi > vi_end));
- TEST_CHECK_EQUAL(*vi, 5);
- TEST_CHECK(++vi != vi_end);
- TEST_CHECK(vi < vi_end);
- TEST_CHECK(! (vi > vi_end));
- TEST_CHECK_EQUAL(*vi, 10);
- TEST_CHECK(++vi == vi_end);
-
- std::for_each(v.begin(), v.end(), Deleter());
- }
- } test_indirect_iterator_vec_p_int;
-
- /**
- * \test Test IndirectIterator over a list of int *.
- *
- */
- struct IndirectIteratorListPIntTest : TestCase
- {
- IndirectIteratorListPIntTest() : TestCase("list<int *>") { }
-
- void run()
- {
- std::list<int *> v;
- v.push_back(new int(5));
- v.push_back(new int(10));
- IndirectIterator<std::list<int *>::iterator, int> vi(v.begin()), vi_end(v.end());
- TEST_CHECK(vi != vi_end);
- TEST_CHECK_EQUAL(*vi, 5);
- TEST_CHECK(++vi != vi_end);
- TEST_CHECK_EQUAL(*vi, 10);
- TEST_CHECK(++vi == vi_end);
-
- std::for_each(v.begin(), v.end(), Deleter());
- }
- } test_indirect_iterator_list_p_int;
-}
-
-#ifndef DOXYGEN
-struct Counter
-{
- int n;
-
- Counter() :
- n(0)
- {
- }
-
- int operator() ()
- {
- return n++;
- }
-};
-
-int is_even(const int & v)
-{
- return ! (v & 1);
-}
-#endif
-
-
-namespace test_cases
-{
- /**
- * \test Test FilterInsertIterator.
- *
- */
- struct FilterInsertIteratorTest : TestCase
- {
- FilterInsertIteratorTest() : TestCase("filter insert iterator") { }
-
- void run()
- {
- std::set<int> v;
- std::generate_n(filter_inserter(std::inserter(v, v.begin()), std::ptr_fun(&is_even)),
- 5, Counter());
- TEST_CHECK_EQUAL(v.size(), std::size_t(3));
- for (int n = 0 ; n < 5 ; ++n)
- {
- TestMessageSuffix s("n=" + stringify(n));
- if (is_even(n))
- {
- TEST_CHECK(v.end() != v.find(n));
- TEST_CHECK_EQUAL(*v.find(n), n);
- }
- else
- TEST_CHECK(v.end() == v.find(n));
- }
- }
- } test_filter_insert_iterator;
-
- /**
- * \test Test iterator_utilities next()
- *
- */
- struct IteratorNextTest : public TestCase
- {
- IteratorNextTest() : TestCase("iterator next()") { }
-
- void run()
- {
- std::vector<int> v;
- v.push_back(1);
- v.push_back(2);
- v.push_back(3);
- std::vector<int>::iterator iter(v.begin());
-
- TEST_CHECK(*(next(iter)) == 2);
- TEST_CHECK(next(next(next(iter))) == v.end());
- TEST_CHECK(next(iter, 3) == v.end());
- iter = next(iter);
- TEST_CHECK(*(next(iter, 1)) == 3);
- iter = next(iter);
- TEST_CHECK(++iter == v.end());
- }
- } test_iterator_next;
-
- /**
- * \test Test iterator_utilities previous()
- *
- */
- struct IteratorpreviousTest : public TestCase
- {
- IteratorpreviousTest() : TestCase("iterator previous()") { }
-
- void run()
- {
- std::vector<int> v;
- v.push_back(1);
- v.push_back(2);
- std::vector<int>::iterator iter(v.end());
-
- TEST_CHECK(*(previous(iter)) == 2);
- TEST_CHECK(previous(previous(iter)) == v.begin());
- iter = previous(iter);
- TEST_CHECK(--iter == v.begin());
- }
- } test_iterator_previous;
-}
-
-namespace
-{
- int f(const int & v)
- {
- return -v;
- }
-}
-
-namespace test_cases
-{
- /**
- * \test Test TransformInsertIterator.
- *
- */
- struct TransformInsertIteratorTest : TestCase
- {
- TransformInsertIteratorTest() : TestCase("transform insert iterator") { }
-
- void run()
- {
- std::vector<int> v;
- std::generate_n(transform_inserter(std::back_inserter(v), std::ptr_fun(&f)),
- 5, Counter());
- TEST_CHECK_EQUAL(v.size(), std::size_t(5));
- for (int n = 0 ; n < 5 ; ++n)
- {
- TestMessageSuffix s("n=" + stringify(n));
- TEST_CHECK_EQUAL(v.at(n), -n);
- }
- }
- } test_transform_insert_iterator;
-}
-
-#ifndef DOXYGEN
-struct C
-{
- std::string s;
-
- explicit C(const std::string & ss) :
- s(ss)
- {
- }
-};
-#endif
-
-namespace test_cases
-{
- /**
- * \test Test create_inserter.
- *
- */
- struct CreateInsertIteratorTest : TestCase
- {
- CreateInsertIteratorTest() : TestCase("create insert iterator") { }
-
- void run()
- {
- std::vector<std::string> v;
- v.push_back("one");
- v.push_back("two");
-
- std::vector<C> vv;
- std::copy(v.begin(), v.end(), create_inserter<C>(std::back_inserter(vv)));
-
- TEST_CHECK_EQUAL(vv.size(), std::size_t(2));
- TEST_CHECK_EQUAL(vv.at(0).s, "one");
- TEST_CHECK_EQUAL(vv.at(1).s, "two");
- }
- } test_create_insert_iterator;
-}
-
-namespace test_cases
-{
- /**
- * \test Test first_iterator.
- *
- */
- struct FirstIteratorTest : TestCase
- {
- FirstIteratorTest() : TestCase("first_iterator") {}
-
- void run()
- {
- typedef std::vector<std::pair<std::string, std::string> > V;
-
- V v;
- v.push_back(std::pair<std::string, std::string>("one", "I"));
- v.push_back(std::pair<std::string, std::string>("two", "II"));
- v.push_back(std::pair<std::string, std::string>("three", "III"));
- v.push_back(std::pair<std::string, std::string>("four", "IV"));
- v.push_back(std::pair<std::string, std::string>("five", "V"));
-
- FirstIterator<V::iterator>::Type it = first_iterator(v.begin());
- TEST_CHECK(it == it);
- TEST_CHECK(! (it != it));
- TEST_CHECK_EQUAL(*it, "one");
- TEST_CHECK_EQUAL(it->length(), 3U);
-
- FirstIterator<V::iterator>::Type it2(it);
- TEST_CHECK(it == it2);
- TEST_CHECK(! (it != it2));
- TEST_CHECK_EQUAL(*++it2, "two");
- TEST_CHECK_EQUAL(*it2, "two");
- TEST_CHECK_EQUAL(it2->length(), 3U);
- TEST_CHECK(it != it2);
- TEST_CHECK(! (it == it2));
-
- FirstIterator<V::iterator>::Type it3(it2);
- TEST_CHECK(it2 == it3++);
- TEST_CHECK(it2 != it3);
- TEST_CHECK_EQUAL(*it3, "three");
- TEST_CHECK_EQUAL(it3->length(), 5U);
-
- it3 = it2;
- TEST_CHECK(it2 == it3);
- TEST_CHECK_EQUAL(*it3, "two");
- TEST_CHECK_EQUAL(*it3++, "two");
-
- TEST_CHECK_EQUAL(join(first_iterator(v.begin()), first_iterator(v.end()), " "), "one two three four five");
- }
- } first_iterator_test;
-
- /**
- * \test Test second_iterator.
- *
- */
- struct SecondIteratorTest : TestCase
- {
- SecondIteratorTest() : TestCase("second_iterator") {}
-
- void run()
- {
- typedef std::map<std::string, std::string> M;
-
- M m;
- m["I"] = "one";
- m["II"] = "two";
- m["III"] = "three";
- m["IV"] = "four";
- m["V"] = "five";
-
- SecondIterator<M::iterator>::Type it = second_iterator(m.begin());
- TEST_CHECK(it == it);
- TEST_CHECK(! (it != it));
- TEST_CHECK_EQUAL(*it, "one");
- TEST_CHECK_EQUAL(it->length(), 3U);
-
- SecondIterator<M::iterator>::Type it2(it);
- TEST_CHECK(it == it2);
- TEST_CHECK(! (it != it2));
- TEST_CHECK_EQUAL(*++it2, "two");
- TEST_CHECK_EQUAL(*it2, "two");
- TEST_CHECK_EQUAL(it2->length(), 3U);
- TEST_CHECK(it != it2);
- TEST_CHECK(! (it == it2));
-
- SecondIterator<M::iterator>::Type it3(it2);
- TEST_CHECK(it2 == it3++);
- TEST_CHECK(it2 != it3);
- TEST_CHECK_EQUAL(*it3, "three");
- TEST_CHECK_EQUAL(it3->length(), 5U);
-
- it3 = it2;
- TEST_CHECK(it2 == it3);
- TEST_CHECK_EQUAL(*it3, "two");
- TEST_CHECK_EQUAL(*it3++, "two");
-
- TEST_CHECK_EQUAL(join(second_iterator(m.begin()), second_iterator(m.end()), " "), "one two three four five");
- }
- } second_iterator_test;
-}
diff --git a/paludis/util/map-impl.hh b/paludis/util/map-impl.hh
index 46e2241..dec99f4 100644
--- a/paludis/util/map-impl.hh
+++ b/paludis/util/map-impl.hh
@@ -22,8 +22,8 @@
#include <paludis/util/map.hh>
#include <paludis/util/private_implementation_pattern-impl.hh>
-#include <libwrapiter/libwrapiter_output_iterator.hh>
-#include <libwrapiter/libwrapiter_forward_iterator.hh>
+#include <paludis/util/wrapped_output_iterator-impl.hh>
+#include <paludis/util/wrapped_forward_iterator-impl.hh>
#include <map>
#include <iterator>
#include <functional>
diff --git a/paludis/util/map.cc b/paludis/util/map.cc
index c562eb6..4451fa4 100644
--- a/paludis/util/map.cc
+++ b/paludis/util/map.cc
@@ -19,9 +19,13 @@
#include <paludis/util/map.hh>
#include <paludis/util/map-impl.hh>
+#include <paludis/util/wrapped_forward_iterator-impl.hh>
+#include <paludis/util/wrapped_output_iterator-impl.hh>
#include <string>
using namespace paludis;
template class Map<std::string, std::string>;
+template class WrappedForwardIterator<Map<std::string, std::string>::ConstIteratorTag, const std::pair<const std::string, std::string> >;
+template class WrappedOutputIterator<Map<std::string, std::string>::InserterTag, std::pair<const std::string, std::string> >;
diff --git a/paludis/util/map.hh b/paludis/util/map.hh
index 8945000..731d753 100644
--- a/paludis/util/map.hh
+++ b/paludis/util/map.hh
@@ -24,9 +24,8 @@
#include <paludis/util/attributes.hh>
#include <paludis/util/instantiation_policy.hh>
#include <paludis/util/private_implementation_pattern.hh>
-
-#include <libwrapiter/libwrapiter_forward_iterator-fwd.hh>
-#include <libwrapiter/libwrapiter_output_iterator-fwd.hh>
+#include <paludis/util/wrapped_output_iterator-fwd.hh>
+#include <paludis/util/wrapped_forward_iterator-fwd.hh>
#include <utility>
@@ -70,12 +69,12 @@ namespace paludis
///\name Iteration
///\{
- typedef libwrapiter::ForwardIterator<Map<K_, V_, C_>, const std::pair<const K_, V_> > ConstIterator;
+ typedef WrappedForwardIterator<enum ConstIteratorTag { }, const std::pair<const K_, V_> > ConstIterator;
ConstIterator begin() const PALUDIS_ATTRIBUTE((warn_unused_result));
ConstIterator end() const PALUDIS_ATTRIBUTE((warn_unused_result));
ConstIterator find(const K_ &) const PALUDIS_ATTRIBUTE((warn_unused_result));
- typedef libwrapiter::OutputIterator<Map<K_, V_, C_>, std::pair<const K_, V_> > Inserter;
+ typedef WrappedOutputIterator<enum InserterTag { }, std::pair<const K_, V_> > Inserter;
Inserter inserter() PALUDIS_ATTRIBUTE((warn_unused_result));
///\}
diff --git a/paludis/util/pstream.cc b/paludis/util/pstream.cc
index fe3dc0c..946c715 100644
--- a/paludis/util/pstream.cc
+++ b/paludis/util/pstream.cc
@@ -20,7 +20,7 @@
#include <paludis/util/log.hh>
#include <paludis/util/pstream.hh>
#include <paludis/util/stringify.hh>
-#include <libwrapiter/libwrapiter_forward_iterator.hh>
+#include <paludis/util/wrapped_forward_iterator.hh>
#include <cstring>
#include <iostream>
diff --git a/paludis/util/sequence-impl.hh b/paludis/util/sequence-impl.hh
index eb56aa2..c364c18 100644
--- a/paludis/util/sequence-impl.hh
+++ b/paludis/util/sequence-impl.hh
@@ -22,8 +22,8 @@
#include <paludis/util/sequence.hh>
#include <paludis/util/private_implementation_pattern-impl.hh>
-#include <libwrapiter/libwrapiter_output_iterator.hh>
-#include <libwrapiter/libwrapiter_forward_iterator.hh>
+#include <paludis/util/wrapped_output_iterator-impl.hh>
+#include <paludis/util/wrapped_forward_iterator-impl.hh>
#include <list>
#include <iterator>
diff --git a/paludis/util/sequence.hh b/paludis/util/sequence.hh
index bc409b8..b6ed4b9 100644
--- a/paludis/util/sequence.hh
+++ b/paludis/util/sequence.hh
@@ -23,9 +23,8 @@
#include <paludis/util/sequence-fwd.hh>
#include <paludis/util/private_implementation_pattern.hh>
#include <paludis/util/instantiation_policy.hh>
-
-#include <libwrapiter/libwrapiter_forward_iterator-fwd.hh>
-#include <libwrapiter/libwrapiter_output_iterator-fwd.hh>
+#include <paludis/util/wrapped_forward_iterator-fwd.hh>
+#include <paludis/util/wrapped_output_iterator-fwd.hh>
/** \file
* Declarations for the Sequence<> class.
@@ -76,17 +75,16 @@ namespace paludis
///\name Iteration
///\{
- typedef libwrapiter::ForwardIterator<Sequence<T_>, const T_> ConstIterator;
+ typedef WrappedForwardIterator<enum ConstIteratorTag { }, const T_> ConstIterator;
ConstIterator begin() const PALUDIS_ATTRIBUTE((warn_unused_result));
ConstIterator end() const PALUDIS_ATTRIBUTE((warn_unused_result));
ConstIterator last() const PALUDIS_ATTRIBUTE((warn_unused_result));
- struct ReverseConstIteratorTag;
- typedef libwrapiter::ForwardIterator<typename Sequence<T_>::ReverseConstIteratorTag, const T_> ReverseConstIterator;
+ typedef WrappedForwardIterator<enum ReverseConstIteratorTag { }, const T_> ReverseConstIterator;
ReverseConstIterator rbegin() const PALUDIS_ATTRIBUTE((warn_unused_result));
ReverseConstIterator rend() const PALUDIS_ATTRIBUTE((warn_unused_result));
- typedef libwrapiter::OutputIterator<Sequence<T_>, T_> Inserter;
+ typedef WrappedOutputIterator<enum InserterTag { }, T_> Inserter;
Inserter back_inserter();
Inserter front_inserter();
diff --git a/paludis/util/set-impl.hh b/paludis/util/set-impl.hh
index 781ed09..b3e1521 100644
--- a/paludis/util/set-impl.hh
+++ b/paludis/util/set-impl.hh
@@ -22,6 +22,8 @@
#include <paludis/util/set.hh>
#include <paludis/util/private_implementation_pattern-impl.hh>
+#include <paludis/util/wrapped_forward_iterator-impl.hh>
+#include <paludis/util/wrapped_output_iterator-impl.hh>
#include <set>
#include <functional>
diff --git a/paludis/util/set.hh b/paludis/util/set.hh
index 0bcc378..65bc92d 100644
--- a/paludis/util/set.hh
+++ b/paludis/util/set.hh
@@ -24,9 +24,8 @@
#include <paludis/util/attributes.hh>
#include <paludis/util/private_implementation_pattern.hh>
#include <paludis/util/instantiation_policy.hh>
-
-#include <libwrapiter/libwrapiter_forward_iterator-fwd.hh>
-#include <libwrapiter/libwrapiter_output_iterator-fwd.hh>
+#include <paludis/util/wrapped_forward_iterator-fwd.hh>
+#include <paludis/util/wrapped_output_iterator-fwd.hh>
/** \file
* Declarations for the Set<> class.
@@ -76,12 +75,12 @@ namespace paludis
///\name Iteration
///\{
- typedef libwrapiter::ForwardIterator<Set<T_, C_>, const T_> ConstIterator;
+ typedef WrappedForwardIterator<enum ConstIteratorTag { }, const T_> ConstIterator;
ConstIterator begin() const PALUDIS_ATTRIBUTE((warn_unused_result));
ConstIterator end() const PALUDIS_ATTRIBUTE((warn_unused_result));
ConstIterator find(const T_ &) const PALUDIS_ATTRIBUTE((warn_unused_result));
- typedef libwrapiter::OutputIterator<Set<T_, C_>, T_> Inserter;
+ typedef WrappedOutputIterator<enum InserterTag { }, T_> Inserter;
Inserter inserter();
///\}
diff --git a/paludis/util/system.cc b/paludis/util/system.cc
index 82c5942..9b96ef4 100644
--- a/paludis/util/system.cc
+++ b/paludis/util/system.cc
@@ -24,7 +24,8 @@
#include <paludis/util/stringify.hh>
#include <paludis/util/destringify.hh>
#include <paludis/util/private_implementation_pattern-impl.hh>
-#include <libwrapiter/libwrapiter_forward_iterator.hh>
+#include <paludis/util/wrapped_forward_iterator-impl.hh>
+
#include <sys/utsname.h>
#include <sys/types.h>
#include <sys/wait.h>
@@ -38,6 +39,8 @@
using namespace paludis;
+template class WrappedForwardIterator<Command::ConstIteratorTag, const std::pair<const std::string, std::string> >;
+
namespace
{
static int stdout_write_fd = -1;
diff --git a/paludis/util/system.hh b/paludis/util/system.hh
index cb54e09..24d32ad 100644
--- a/paludis/util/system.hh
+++ b/paludis/util/system.hh
@@ -23,7 +23,7 @@
#include <paludis/util/exception.hh>
#include <paludis/util/private_implementation_pattern.hh>
#include <paludis/util/tr1_memory.hh>
-#include <libwrapiter/libwrapiter_forward_iterator-fwd.hh>
+#include <paludis/util/wrapped_forward_iterator-fwd.hh>
#include <string>
#include <sys/types.h>
@@ -226,7 +226,7 @@ namespace paludis
///\name Iterate over our setenvs.
///\{
- typedef libwrapiter::ForwardIterator<Command, const std::pair<const std::string, std::string> > ConstIterator;
+ typedef WrappedForwardIterator<enum ConstIteratorTag { }, const std::pair<const std::string, std::string> > ConstIterator;
ConstIterator begin_setenvs() const;
ConstIterator end_setenvs() const;
diff --git a/paludis/util/tr1_type_traits.hh b/paludis/util/tr1_type_traits.hh
index 4f0f067..56b45ac 100644
--- a/paludis/util/tr1_type_traits.hh
+++ b/paludis/util/tr1_type_traits.hh
@@ -30,6 +30,7 @@ namespace paludis
{
using std::tr1::remove_pointer;
using std::tr1::remove_const;
+ using std::tr1::remove_reference;
using std::tr1::is_same;
using std::tr1::is_convertible;
}
@@ -45,6 +46,7 @@ namespace paludis
{
using boost::remove_pointer;
using boost::remove_const;
+ using boost::remove_reference;
using boost::is_same;
using boost::is_convertible;
}
diff --git a/paludis/util/virtual_constructor-impl.hh b/paludis/util/virtual_constructor-impl.hh
index b88be22..af9d92f 100644
--- a/paludis/util/virtual_constructor-impl.hh
+++ b/paludis/util/virtual_constructor-impl.hh
@@ -22,7 +22,6 @@
#include <paludis/util/virtual_constructor.hh>
#include <paludis/util/stringify.hh>
-#include <paludis/util/iterator.hh>
#include <paludis/util/tr1_functional.hh>
#include <algorithm>
#include <vector>
@@ -148,8 +147,8 @@ namespace paludis
void
VirtualConstructor<KeyType_, ValueType_, NotFoundBehaviour_>::copy_keys(T_ out_iter) const
{
- std::copy(_entries_holder->entries.begin(), _entries_holder->entries.end(), transform_inserter(out_iter,
- paludis::tr1::mem_fn(&std::pair<KeyType_, ValueType_>::first)));
+ std::transform(_entries_holder->entries.begin(), _entries_holder->entries.end(), out_iter,
+ paludis::tr1::mem_fn(&std::pair<KeyType_, ValueType_>::first));
}
}
diff --git a/paludis/util/visitor-impl.hh b/paludis/util/visitor-impl.hh
index 14e28fd..7c1bb88 100644
--- a/paludis/util/visitor-impl.hh
+++ b/paludis/util/visitor-impl.hh
@@ -21,9 +21,9 @@
#define PALUDIS_GUARD_PALUDIS_UTIL_VISITOR_IMPL_HH 1
#include <paludis/util/visitor.hh>
-#include <paludis/util/sequence.hh>
#include <paludis/util/sequence-impl.hh>
-#include <paludis/util/iterator.hh>
+#include <paludis/util/indirect_iterator-impl.hh>
+#include <algorithm>
/** \file
* Implementation for paludis/util/visitor.hh .
diff --git a/paludis/util/visitor.hh b/paludis/util/visitor.hh
index a2f4860..23c0521 100644
--- a/paludis/util/visitor.hh
+++ b/paludis/util/visitor.hh
@@ -26,7 +26,7 @@
#include <paludis/util/tr1_memory.hh>
#include <paludis/util/tr1_type_traits.hh>
#include <paludis/util/operators.hh>
-#include <libwrapiter/libwrapiter_forward_iterator-fwd.hh>
+#include <paludis/util/wrapped_forward_iterator-fwd.hh>
/** \file
* Declares the Visitor and related classes.
@@ -637,8 +637,8 @@ namespace paludis
///\name Visitor operations
///\{
- typedef libwrapiter::ForwardIterator<TreeSequenceIteratorTypes, const ConstAcceptInterface<H_> > ConstIterator;
- typedef libwrapiter::ForwardIterator<TreeSequenceIteratorTypes, AcceptInterface<H_> > Iterator;
+ typedef WrappedForwardIterator<enum ConstIteratorTag { }, const ConstAcceptInterface<H_> > ConstIterator;
+ typedef WrappedForwardIterator<enum IteratorTag { }, AcceptInterface<H_> > Iterator;
///\}
};
diff --git a/paludis/util/visitor_TEST.cc b/paludis/util/visitor_TEST.cc
index d75a132..144e4a9 100644
--- a/paludis/util/visitor_TEST.cc
+++ b/paludis/util/visitor_TEST.cc
@@ -18,7 +18,6 @@
*/
#include <list>
-#include <paludis/util/iterator.hh>
#include <paludis/util/visitor.hh>
#include <paludis/util/visitor-impl.hh>
#include <paludis/util/no_type.hh>
diff --git a/paludis/version_requirements.cc b/paludis/version_requirements.cc
index 2de240e..33c873f 100644
--- a/paludis/version_requirements.cc
+++ b/paludis/version_requirements.cc
@@ -21,14 +21,16 @@
#include <paludis/util/stringify.hh>
#include <paludis/util/sequence.hh>
#include <paludis/util/sequence-impl.hh>
-#include <libwrapiter/libwrapiter_output_iterator.hh>
-#include <libwrapiter/libwrapiter_forward_iterator.hh>
+#include <paludis/util/wrapped_forward_iterator-impl.hh>
+#include <paludis/util/wrapped_output_iterator-impl.hh>
using namespace paludis;
#include <paludis/version_requirements-sr.cc>
template class Sequence<VersionRequirement>;
+template class WrappedForwardIterator<Sequence<VersionRequirement>::ConstIteratorTag, const VersionRequirement>;
+template class WrappedOutputIterator<Sequence<VersionRequirement>::InserterTag, VersionRequirement>;
tr1::shared_ptr<VersionRequirements>
paludis::make_equal_to_version_requirements(const VersionSpec & v)
diff --git a/paludis/version_spec.cc b/paludis/version_spec.cc
index 06b703d..8e349bf 100644
--- a/paludis/version_spec.cc
+++ b/paludis/version_spec.cc
@@ -21,11 +21,11 @@
#include <paludis/util/destringify.hh>
#include <paludis/util/exception.hh>
#include <paludis/util/stringify.hh>
-#include <paludis/util/iterator.hh>
#include <paludis/util/strip.hh>
#include <paludis/util/log.hh>
#include <paludis/util/private_implementation_pattern-impl.hh>
#include <paludis/util/mutex.hh>
+#include <paludis/util/iterator_funcs.hh>
#include <paludis/version_spec.hh>
#include <vector>
#include <limits>
diff --git a/src/clients/adjutrix/display_default_system_resolution.cc b/src/clients/adjutrix/display_default_system_resolution.cc
index d94f137..0973b95 100644
--- a/src/clients/adjutrix/display_default_system_resolution.cc
+++ b/src/clients/adjutrix/display_default_system_resolution.cc
@@ -28,6 +28,7 @@
#include <paludis/util/is_file_with_extension.hh>
#include <paludis/util/set.hh>
#include <paludis/util/strip.hh>
+#include <paludis/util/wrapped_forward_iterator-impl.hh>
#include <paludis/dep_list.hh>
#include <paludis/dep_list_exceptions.hh>
diff --git a/src/clients/adjutrix/downgrade_check.cc b/src/clients/adjutrix/downgrade_check.cc
index 939b498..5f6630e 100644
--- a/src/clients/adjutrix/downgrade_check.cc
+++ b/src/clients/adjutrix/downgrade_check.cc
@@ -24,6 +24,8 @@
#include <paludis/util/sr.hh>
#include <paludis/util/tokeniser.hh>
#include <paludis/util/sequence.hh>
+#include <paludis/util/indirect_iterator.hh>
+#include <paludis/util/iterator_funcs.hh>
#include <paludis/package_id.hh>
#include <fstream>
#include <iostream>
diff --git a/src/clients/adjutrix/find_dropped_keywords.cc b/src/clients/adjutrix/find_dropped_keywords.cc
index 069fb64..796c340 100644
--- a/src/clients/adjutrix/find_dropped_keywords.cc
+++ b/src/clients/adjutrix/find_dropped_keywords.cc
@@ -21,7 +21,8 @@
#include "command_line.hh"
#include <paludis/util/tokeniser.hh>
-#include <paludis/util/iterator.hh>
+#include <paludis/util/iterator_funcs.hh>
+#include <paludis/util/indirect_iterator-impl.hh>
#include <paludis/util/sequence.hh>
#include <paludis/util/set.hh>
#include <paludis/version_spec.hh>
diff --git a/src/clients/adjutrix/find_insecure_packages.cc b/src/clients/adjutrix/find_insecure_packages.cc
index 480fbd1..0b26760 100644
--- a/src/clients/adjutrix/find_insecure_packages.cc
+++ b/src/clients/adjutrix/find_insecure_packages.cc
@@ -27,6 +27,7 @@
#include <paludis/package_id.hh>
#include <paludis/package_database.hh>
#include <paludis/util/visitor-impl.hh>
+#include <paludis/util/iterator_funcs.hh>
#include <set>
#include <map>
diff --git a/src/clients/adjutrix/find_reverse_deps.cc b/src/clients/adjutrix/find_reverse_deps.cc
index 249a5af..8dd45d8 100644
--- a/src/clients/adjutrix/find_reverse_deps.cc
+++ b/src/clients/adjutrix/find_reverse_deps.cc
@@ -32,8 +32,6 @@
#include <paludis/package_database.hh>
#include <paludis/metadata_key.hh>
#include <paludis/fuzzy_finder.hh>
-#include <libwrapiter/libwrapiter_forward_iterator.hh>
-#include <libwrapiter/libwrapiter_output_iterator.hh>
#include <set>
#include <map>
diff --git a/src/clients/adjutrix/find_stable_candidates.cc b/src/clients/adjutrix/find_stable_candidates.cc
index 0223ba3..ba9a50c 100644
--- a/src/clients/adjutrix/find_stable_candidates.cc
+++ b/src/clients/adjutrix/find_stable_candidates.cc
@@ -21,9 +21,10 @@
#include "command_line.hh"
#include <paludis/util/tokeniser.hh>
-#include <paludis/util/iterator.hh>
+#include <paludis/util/iterator_funcs.hh>
#include <paludis/util/sequence.hh>
#include <paludis/util/set.hh>
+#include <paludis/util/indirect_iterator.hh>
#include <paludis/version_spec.hh>
#include <paludis/repository.hh>
#include <paludis/package_database.hh>
diff --git a/src/clients/adjutrix/find_unused_packages.cc b/src/clients/adjutrix/find_unused_packages.cc
index 83a4d6c..8438f53 100644
--- a/src/clients/adjutrix/find_unused_packages.cc
+++ b/src/clients/adjutrix/find_unused_packages.cc
@@ -22,7 +22,7 @@
#include <paludis/find_unused_packages_task.hh>
#include <paludis/util/tokeniser.hh>
-#include <paludis/util/iterator.hh>
+#include <paludis/util/indirect_iterator.hh>
#include <paludis/util/set.hh>
#include <paludis/util/sequence.hh>
#include <paludis/package_database.hh>
diff --git a/src/clients/adjutrix/keywords_graph.cc b/src/clients/adjutrix/keywords_graph.cc
index a943c6b..4407261 100644
--- a/src/clients/adjutrix/keywords_graph.cc
+++ b/src/clients/adjutrix/keywords_graph.cc
@@ -26,6 +26,7 @@
#include <paludis/util/tr1_functional.hh>
#include <paludis/util/sequence.hh>
#include <paludis/util/set.hh>
+#include <paludis/util/indirect_iterator-impl.hh>
#include <paludis/query.hh>
#include <paludis/repository.hh>
#include <paludis/package_database.hh>
@@ -92,8 +93,9 @@ namespace
return;
std::set<SlotName> slots;
- std::copy(packages->begin(), packages->end(),
- transform_inserter(std::inserter(slots, slots.begin()), tr1::mem_fn(&PackageID::slot)));
+ std::transform(packages->begin(), packages->end(),
+ std::inserter(slots, slots.begin()),
+ tr1::mem_fn(&PackageID::slot));
unsigned version_specs_columns_width(std::max_element(indirect_iterator(packages->begin()),
indirect_iterator(packages->end()),
diff --git a/src/clients/adjutrix/what_needs_keywording.cc b/src/clients/adjutrix/what_needs_keywording.cc
index 0d5b63a..a170226 100644
--- a/src/clients/adjutrix/what_needs_keywording.cc
+++ b/src/clients/adjutrix/what_needs_keywording.cc
@@ -26,6 +26,7 @@
#include <paludis/util/set.hh>
#include <paludis/util/sequence.hh>
#include <paludis/util/tr1_functional.hh>
+#include <paludis/util/iterator_funcs.hh>
#include <paludis/repositories/fake/fake_installed_repository.hh>
#include <paludis/dep_list_exceptions.hh>
#include <paludis/dep_list.hh>
diff --git a/src/clients/paludis/applets.cc b/src/clients/paludis/applets.cc
index 7aafcae..28a3d6a 100644
--- a/src/clients/paludis/applets.cc
+++ b/src/clients/paludis/applets.cc
@@ -29,8 +29,6 @@
#include <paludis/util/tokeniser.hh>
#include <paludis/util/virtual_constructor-impl.hh>
#include <paludis/repository_maker.hh>
-#include <libwrapiter/libwrapiter_forward_iterator.hh>
-#include <libwrapiter/libwrapiter_output_iterator.hh>
#include <string>
#include <set>
#include <map>
diff --git a/src/clients/paludis/info.cc b/src/clients/paludis/info.cc
index ed91352..cd6c8f0 100644
--- a/src/clients/paludis/info.cc
+++ b/src/clients/paludis/info.cc
@@ -21,7 +21,6 @@
#include "command_line.hh"
#include "src/output/colour.hh"
#include <paludis/about.hh>
-#include <paludis/util/iterator.hh>
#include <paludis/util/sequence.hh>
#include <paludis/util/visitor-impl.hh>
#include <paludis/package_database.hh>
@@ -32,8 +31,6 @@
#include <paludis/action.hh>
#include <iostream>
#include <iomanip>
-#include <libebt/libebt.hh>
-#include <libwrapiter/libwrapiter.hh>
#include <sys/types.h>
#include <pwd.h>
#include <grp.h>
@@ -119,11 +116,6 @@ do_info(const tr1::shared_ptr<const Environment> & env)
<< "GNU libstdc++ " << STRINGIFY(__GLIBCXX__)
#endif
<< endl;
- cout << " " << std::setw(22) << std::left << ("libebt:") << std::setw(0) << " "
- << LIBEBT_VERSION_MAJOR << "." << LIBEBT_VERSION_MINOR << "." << LIBEBT_VERSION_MICRO << endl;
- cout << " " << std::setw(22) << std::left << ("libwrapiter:") << std::setw(0) << " "
- << LIBWRAPITER_VERSION_MAJOR << "." << LIBWRAPITER_VERSION_MINOR << "." << LIBWRAPITER_VERSION_MICRO << endl;
-
cout << endl;
cout << " " << colour(cl_heading, "Reduced Privs:") << endl;
diff --git a/src/clients/paludis/install.cc b/src/clients/paludis/install.cc
index 321d60a..b49e4f8 100644
--- a/src/clients/paludis/install.cc
+++ b/src/clients/paludis/install.cc
@@ -40,9 +40,6 @@
#include <paludis/mask.hh>
#include <paludis/action.hh>
-#include <libwrapiter/libwrapiter_forward_iterator.hh>
-#include <libwrapiter/libwrapiter_output_iterator.hh>
-
/** \file
* Handle the --install action for the main paludis program.
*/
diff --git a/src/clients/paludis/list.cc b/src/clients/paludis/list.cc
index 9c78b1c..3820121 100644
--- a/src/clients/paludis/list.cc
+++ b/src/clients/paludis/list.cc
@@ -26,6 +26,7 @@
#include <paludis/util/log.hh>
#include <paludis/util/visitor.hh>
#include <paludis/util/set.hh>
+#include <paludis/util/indirect_iterator-impl.hh>
#include <src/output/colour.hh>
#include <paludis/util/tr1_memory.hh>
diff --git a/src/clients/paludis/paludis.cc b/src/clients/paludis/paludis.cc
index 42814e9..39f3d25 100644
--- a/src/clients/paludis/paludis.cc
+++ b/src/clients/paludis/paludis.cc
@@ -41,9 +41,6 @@
#include <paludis/util/log.hh>
#include <paludis/fuzzy_finder.hh>
-#include <libebt/libebt.hh>
-#include <libwrapiter/libwrapiter.hh>
-
#include <iostream>
#include <iomanip>
#include <string>
diff --git a/src/clients/reconcilio/broken_linkage_finder/Makefile.am b/src/clients/reconcilio/broken_linkage_finder/Makefile.am
index fb73cb6..70d9f1e 100644
--- a/src/clients/reconcilio/broken_linkage_finder/Makefile.am
+++ b/src/clients/reconcilio/broken_linkage_finder/Makefile.am
@@ -26,6 +26,7 @@ configuration_TEST_SOURCES = configuration_TEST.cc
configuration_TEST_LDADD = \
libbrokenlinkagefinder.a \
../util/libreconcilioutil.a \
+ $(top_builddir)/src/clients/reconcilio/littlelf/liblittlelf.a \
$(top_builddir)/paludis/libpaludis.la \
$(top_builddir)/paludis/util/libpaludisutil.la \
$(top_builddir)/paludis/util/test_extras.o \
diff --git a/src/clients/reconcilio/broken_linkage_finder/broken_linkage_finder.cc b/src/clients/reconcilio/broken_linkage_finder/broken_linkage_finder.cc
index 0313969..3ea1aab 100644
--- a/src/clients/reconcilio/broken_linkage_finder/broken_linkage_finder.cc
+++ b/src/clients/reconcilio/broken_linkage_finder/broken_linkage_finder.cc
@@ -35,6 +35,8 @@
#include <paludis/util/tr1_functional.hh>
#include <paludis/util/visitor_cast.hh>
#include <paludis/util/visitor-impl.hh>
+#include <paludis/util/wrapped_forward_iterator-impl.hh>
+#include <paludis/util/member_iterator-impl.hh>
#include <paludis/contents.hh>
#include <paludis/environment.hh>
@@ -52,6 +54,12 @@
using namespace paludis;
using namespace broken_linkage_finder;
+template class WrappedForwardIterator<BrokenLinkageFinder::BrokenPackageConstIteratorTag,
+ const paludis::tr1::shared_ptr<const paludis::PackageID> >;
+template class WrappedForwardIterator<BrokenLinkageFinder::BrokenFileConstIteratorTag,
+ const paludis::FSEntry>;
+template class WrappedForwardIterator<BrokenLinkageFinder::MissingRequirementConstIteratorTag, const std::string>;
+
typedef std::multimap<FSEntry, tr1::shared_ptr<const PackageID> > Files;
typedef std::map<FSEntry, std::set<std::string> > PackageBreakage;
typedef std::map<tr1::shared_ptr<const PackageID>, PackageBreakage, PackageIDSetComparator> Breakage;
diff --git a/src/clients/reconcilio/broken_linkage_finder/broken_linkage_finder.hh b/src/clients/reconcilio/broken_linkage_finder/broken_linkage_finder.hh
index a0f38a6..b7f4873 100644
--- a/src/clients/reconcilio/broken_linkage_finder/broken_linkage_finder.hh
+++ b/src/clients/reconcilio/broken_linkage_finder/broken_linkage_finder.hh
@@ -25,12 +25,11 @@
#include <paludis/util/instantiation_policy.hh>
#include <paludis/util/private_implementation_pattern.hh>
#include <paludis/util/tr1_memory.hh>
+#include <paludis/util/wrapped_forward_iterator-fwd.hh>
#include <paludis/environment-fwd.hh>
#include <paludis/package_id-fwd.hh>
-#include <libwrapiter/libwrapiter_forward_iterator-fwd.hh>
-
class BrokenLinkageFinder :
private paludis::PrivateImplementationPattern<BrokenLinkageFinder>,
private paludis::InstantiationPolicy<BrokenLinkageFinder, paludis::instantiation_method::NonCopyableTag>
@@ -39,23 +38,19 @@ class BrokenLinkageFinder :
BrokenLinkageFinder(const paludis::Environment *, const std::string &);
~BrokenLinkageFinder();
- typedef libwrapiter::ForwardIterator<
- BrokenLinkageFinder, const paludis::tr1::shared_ptr<const paludis::PackageID>
- > BrokenPackageConstIterator;
+ typedef paludis::WrappedForwardIterator<enum BrokenPackageConstIteratorTag { },
+ const paludis::tr1::shared_ptr<const paludis::PackageID>
+ > BrokenPackageConstIterator;
BrokenPackageConstIterator begin_broken_packages() const PALUDIS_ATTRIBUTE((warn_unused_result));
BrokenPackageConstIterator end_broken_packages() const PALUDIS_ATTRIBUTE((warn_unused_result));
- typedef libwrapiter::ForwardIterator<
- BrokenLinkageFinder, const paludis::FSEntry
- > BrokenFileConstIterator;
+ typedef paludis::WrappedForwardIterator<enum BrokenFileConstIteratorTag { }, const paludis::FSEntry> BrokenFileConstIterator;
BrokenFileConstIterator begin_broken_files(const paludis::tr1::shared_ptr<const paludis::PackageID> &)
const PALUDIS_ATTRIBUTE((warn_unused_result));
BrokenFileConstIterator end_broken_files(const paludis::tr1::shared_ptr<const paludis::PackageID> &)
const PALUDIS_ATTRIBUTE((warn_unused_result));
- typedef libwrapiter::ForwardIterator<
- BrokenLinkageFinder, const std::string
- > MissingRequirementConstIterator;
+ typedef paludis::WrappedForwardIterator<enum MissingRequirementConstIteratorTag { }, const std::string> MissingRequirementConstIterator;
MissingRequirementConstIterator begin_missing_requirements(
const paludis::tr1::shared_ptr<const paludis::PackageID> &, const paludis::FSEntry &)
const PALUDIS_ATTRIBUTE((warn_unused_result));
diff --git a/src/clients/reconcilio/broken_linkage_finder/configuration.cc b/src/clients/reconcilio/broken_linkage_finder/configuration.cc
index 621a844..da4189c 100644
--- a/src/clients/reconcilio/broken_linkage_finder/configuration.cc
+++ b/src/clients/reconcilio/broken_linkage_finder/configuration.cc
@@ -32,8 +32,7 @@
#include <paludis/util/system.hh>
#include <paludis/util/tokeniser.hh>
#include <paludis/util/tr1_functional.hh>
-
-#include <libwrapiter/libwrapiter_forward_iterator-impl.hh>
+#include <paludis/util/wrapped_forward_iterator-impl.hh>
#include <algorithm>
#include <functional>
@@ -43,6 +42,8 @@
using namespace paludis;
using namespace broken_linkage_finder;
+template class WrappedForwardIterator<Configuration::DirsIteratorTag, const paludis::FSEntry>;
+
namespace paludis
{
template <>
@@ -77,7 +78,7 @@ namespace
from_string(const tr1::function<std::string (const std::string &)> & source,
const std::string & varname, std::vector<T_> & vec, const std::string & delims)
{
- std::string str(source(varname));
+ std::string str(source.operator() (varname)); /* silly 4.3 ICE */
if (! str.empty())
{
Log::get_instance()->message(ll_debug, lc_context, "Got " + varname + "=\"" + str + "\"");
@@ -90,7 +91,7 @@ namespace
from_string(const tr1::function<std::string (const std::string &)> & source,
const std::string & varname, std::vector<T_> & vec)
{
- std::string str(source(varname));
+ std::string str(source.operator() (varname)); /* silly 4.3 ICE */
if (! str.empty())
{
Log::get_instance()->message(ll_debug, lc_context, "Got " + varname + "=\"" + str + "\"");
diff --git a/src/clients/reconcilio/broken_linkage_finder/configuration.hh b/src/clients/reconcilio/broken_linkage_finder/configuration.hh
index c0fce3f..e3a46a0 100644
--- a/src/clients/reconcilio/broken_linkage_finder/configuration.hh
+++ b/src/clients/reconcilio/broken_linkage_finder/configuration.hh
@@ -24,8 +24,7 @@
#include <paludis/util/fs_entry-fwd.hh>
#include <paludis/util/instantiation_policy.hh>
#include <paludis/util/private_implementation_pattern.hh>
-
-#include <libwrapiter/libwrapiter_forward_iterator-fwd.hh>
+#include <paludis/util/wrapped_forward_iterator-fwd.hh>
#include <string>
@@ -39,7 +38,7 @@ namespace broken_linkage_finder
Configuration(const paludis::FSEntry &);
~Configuration();
- typedef libwrapiter::ForwardIterator<Configuration, const paludis::FSEntry> DirsIterator;
+ typedef paludis::WrappedForwardIterator<enum DirsIteratorTag { }, const paludis::FSEntry> DirsIterator;
DirsIterator begin_search_dirs() const PALUDIS_ATTRIBUTE((warn_unused_result));
DirsIterator end_search_dirs() const PALUDIS_ATTRIBUTE((warn_unused_result));
DirsIterator begin_ld_so_conf() const PALUDIS_ATTRIBUTE((warn_unused_result));
diff --git a/src/clients/reconcilio/broken_linkage_finder/configuration_TEST.cc b/src/clients/reconcilio/broken_linkage_finder/configuration_TEST.cc
index b835941..e8e4bdd 100644
--- a/src/clients/reconcilio/broken_linkage_finder/configuration_TEST.cc
+++ b/src/clients/reconcilio/broken_linkage_finder/configuration_TEST.cc
@@ -21,12 +21,11 @@
#include <paludis/util/fs_entry.hh>
#include <paludis/util/join.hh>
+#include <paludis/util/wrapped_forward_iterator.hh>
#include <test/test_runner.hh>
#include <test/test_framework.hh>
-#include <libwrapiter/libwrapiter_forward_iterator-impl.hh>
-
#include <unistd.h>
using namespace broken_linkage_finder;
diff --git a/src/clients/reconcilio/broken_linkage_finder/elf_linkage_checker.cc b/src/clients/reconcilio/broken_linkage_finder/elf_linkage_checker.cc
index a45a454..8303d90 100644
--- a/src/clients/reconcilio/broken_linkage_finder/elf_linkage_checker.cc
+++ b/src/clients/reconcilio/broken_linkage_finder/elf_linkage_checker.cc
@@ -26,12 +26,12 @@
#include <src/clients/reconcilio/littlelf/elf_types.hh>
#include <paludis/util/fs_entry.hh>
-#include <paludis/util/iterator.hh>
#include <paludis/util/join.hh>
#include <paludis/util/log.hh>
#include <paludis/util/mutex.hh>
#include <paludis/util/private_implementation_pattern-impl.hh>
#include <paludis/util/set.hh>
+#include <paludis/util/member_iterator-impl.hh>
#include <paludis/util/visitor_cast.hh>
#include <paludis/util/visitor-impl.hh>
diff --git a/src/clients/reconcilio/fix_linkage.cc b/src/clients/reconcilio/fix_linkage.cc
index 09780a3..c973baf 100644
--- a/src/clients/reconcilio/fix_linkage.cc
+++ b/src/clients/reconcilio/fix_linkage.cc
@@ -37,8 +37,6 @@
#include <src/output/colour.hh>
-#include <libwrapiter/libwrapiter_forward_iterator-decl.hh>
-
#include <iostream>
using namespace paludis;
diff --git a/src/clients/reconcilio/littlelf/elf.cc b/src/clients/reconcilio/littlelf/elf.cc
index aa5e803..2fffde9 100644
--- a/src/clients/reconcilio/littlelf/elf.cc
+++ b/src/clients/reconcilio/littlelf/elf.cc
@@ -9,12 +9,11 @@
#include <src/clients/reconcilio/util/byte_swap.hh>
-#include <paludis/util/iterator.hh>
#include <paludis/util/make_shared_ptr.hh>
#include <paludis/util/private_implementation_pattern-impl.hh>
#include <paludis/util/visitor-impl.hh>
-
-#include <libwrapiter/libwrapiter_forward_iterator-impl.hh>
+#include <paludis/util/wrapped_forward_iterator-impl.hh>
+#include <paludis/util/iterator_funcs.hh>
#include <string>
#include <exception>
@@ -347,3 +346,6 @@ ElfObject<ElfType_>::get_section_by_index(unsigned int index) const
template class ElfObject<Elf32Type>;
template class ElfObject<Elf64Type>;
+template class WrappedForwardIterator<ElfObject<Elf32Type>::SectionIteratorTag, Section<Elf32Type> >;
+template class WrappedForwardIterator<ElfObject<Elf64Type>::SectionIteratorTag, Section<Elf64Type> >;
+
diff --git a/src/clients/reconcilio/littlelf/elf.hh b/src/clients/reconcilio/littlelf/elf.hh
index 316c2c5..d123070 100644
--- a/src/clients/reconcilio/littlelf/elf.hh
+++ b/src/clients/reconcilio/littlelf/elf.hh
@@ -5,9 +5,7 @@
#include <paludis/util/exception.hh>
#include <paludis/util/private_implementation_pattern.hh>
-
-#include <libwrapiter/libwrapiter_forward_iterator-fwd.hh>
-
+#include <paludis/util/wrapped_forward_iterator-fwd.hh>
#include <iosfwd>
#include <elf.h>
@@ -90,7 +88,7 @@ class ElfObject :
return _hdr.e_shnum;
}
- typedef libwrapiter::ForwardIterator<ElfObject, Section<ElfType_> > SectionIterator;
+ typedef paludis::WrappedForwardIterator<enum SectionIteratorTag { }, Section<ElfType_> > SectionIterator;
SectionIterator section_begin() const;
SectionIterator section_end() const;
diff --git a/src/clients/reconcilio/littlelf/elf_dynamic_section.cc b/src/clients/reconcilio/littlelf/elf_dynamic_section.cc
index a6856cb..bbbd5da 100644
--- a/src/clients/reconcilio/littlelf/elf_dynamic_section.cc
+++ b/src/clients/reconcilio/littlelf/elf_dynamic_section.cc
@@ -7,12 +7,10 @@
#include <paludis/util/clone-impl.hh>
#include <paludis/util/instantiation_policy-impl.hh>
-#include <paludis/util/iterator.hh>
#include <paludis/util/make_shared_ptr.hh>
#include <paludis/util/private_implementation_pattern-impl.hh>
#include <paludis/util/visitor-impl.hh>
-
-#include <libwrapiter/libwrapiter_forward_iterator-impl.hh>
+#include <paludis/util/wrapped_forward_iterator-impl.hh>
#include <istream>
#include <map>
@@ -310,3 +308,7 @@ DynamicSection<ElfType_>::entry_end() const
template class DynamicSection<Elf32Type>;
template class DynamicSection<Elf64Type>;
+template class WrappedForwardIterator<DynamicSection<Elf32Type>::EntryIteratorTag, DynamicEntry<Elf32Type> >;
+template class WrappedForwardIterator<DynamicSection<Elf64Type>::EntryIteratorTag, DynamicEntry<Elf64Type> >;
+
+
diff --git a/src/clients/reconcilio/littlelf/elf_dynamic_section.hh b/src/clients/reconcilio/littlelf/elf_dynamic_section.hh
index 5edc08f..2e17a2e 100644
--- a/src/clients/reconcilio/littlelf/elf_dynamic_section.hh
+++ b/src/clients/reconcilio/littlelf/elf_dynamic_section.hh
@@ -8,6 +8,7 @@
#include <paludis/util/private_implementation_pattern.hh>
#include <paludis/util/tr1_memory.hh>
#include <paludis/util/visitor.hh>
+#include <paludis/util/wrapped_forward_iterator-fwd.hh>
#include <string>
#include <iosfwd>
@@ -202,7 +203,7 @@ class DynamicSection :
void resolve_entry_names(Section<ElfType_> &);
- typedef libwrapiter::ForwardIterator<DynamicSection, DynamicEntry<ElfType_> > EntryIterator;
+ typedef paludis::WrappedForwardIterator<enum EntryIteratorTag { }, DynamicEntry<ElfType_> > EntryIterator;
EntryIterator entry_begin() const;
EntryIterator entry_end() const;
};
diff --git a/src/clients/reconcilio/littlelf/elf_relocation_section.cc b/src/clients/reconcilio/littlelf/elf_relocation_section.cc
index 3fdef06..460a62c 100644
--- a/src/clients/reconcilio/littlelf/elf_relocation_section.cc
+++ b/src/clients/reconcilio/littlelf/elf_relocation_section.cc
@@ -7,8 +7,7 @@
#include <paludis/util/private_implementation_pattern-impl.hh>
#include <paludis/util/visitor-impl.hh>
-
-#include <libwrapiter/libwrapiter_forward_iterator-impl.hh>
+#include <paludis/util/wrapped_forward_iterator-impl.hh>
#include <istream>
#include <vector>
@@ -115,7 +114,18 @@ RelocationSection<ElfType_, Relocation_>::relocation_end() const
}
template class RelocationSection<Elf32Type, Relocation<Elf32Type> >;
+template class WrappedForwardIterator<RelocationSection<Elf32Type, Relocation<Elf32Type> >::RelocationIteratorTag,
+ const Relocation<Elf32Type>::Entry>;
+
template class RelocationSection<Elf32Type, RelocationA<Elf32Type> >;
+template class WrappedForwardIterator<RelocationSection<Elf32Type, RelocationA<Elf32Type> >::RelocationIteratorTag,
+ const RelocationA<Elf32Type>::Entry>;
+
template class RelocationSection<Elf64Type, Relocation<Elf64Type> >;
+template class WrappedForwardIterator<RelocationSection<Elf64Type, Relocation<Elf64Type> >::RelocationIteratorTag,
+ const Relocation<Elf64Type>::Entry>;
+
template class RelocationSection<Elf64Type, RelocationA<Elf64Type> >;
+template class WrappedForwardIterator<RelocationSection<Elf64Type, RelocationA<Elf64Type> >::RelocationIteratorTag,
+ const RelocationA<Elf64Type>::Entry>;
diff --git a/src/clients/reconcilio/littlelf/elf_relocation_section.hh b/src/clients/reconcilio/littlelf/elf_relocation_section.hh
index 4fdfb84..0596081 100644
--- a/src/clients/reconcilio/littlelf/elf_relocation_section.hh
+++ b/src/clients/reconcilio/littlelf/elf_relocation_section.hh
@@ -4,6 +4,7 @@
#include "elf_sections.hh"
#include <paludis/util/private_implementation_pattern.hh>
+#include <paludis/util/wrapped_forward_iterator-fwd.hh>
#include <iosfwd>
@@ -87,7 +88,7 @@ class RelocationSection :
return Relocation_::type_name;
}
- typedef libwrapiter::ForwardIterator<RelocationSection, const typename Relocation_::Entry> RelocationIterator;
+ typedef paludis::WrappedForwardIterator<enum RelocationIteratorTag { }, const typename Relocation_::Entry> RelocationIterator;
RelocationIterator relocation_begin() const;
RelocationIterator relocation_end() const;
};
diff --git a/src/clients/reconcilio/littlelf/elf_symbol_section.cc b/src/clients/reconcilio/littlelf/elf_symbol_section.cc
index 2665665..b945cfa 100644
--- a/src/clients/reconcilio/littlelf/elf_symbol_section.cc
+++ b/src/clients/reconcilio/littlelf/elf_symbol_section.cc
@@ -7,8 +7,7 @@
#include <paludis/util/private_implementation_pattern-impl.hh>
#include <paludis/util/visitor-impl.hh>
-
-#include <libwrapiter/libwrapiter_forward_iterator-impl.hh>
+#include <paludis/util/wrapped_forward_iterator-impl.hh>
#include <istream>
#include <vector>
@@ -186,3 +185,7 @@ SymbolSection<ElfType_>::symbol_end() const
template class SymbolSection<Elf32Type>;
template class SymbolSection<Elf64Type>;
+template class WrappedForwardIterator<SymbolSection<Elf32Type>::SymbolIteratorTag, const Symbol<Elf32Type> >;
+template class WrappedForwardIterator<SymbolSection<Elf64Type>::SymbolIteratorTag, const Symbol<Elf64Type> >;
+
+
diff --git a/src/clients/reconcilio/littlelf/elf_symbol_section.hh b/src/clients/reconcilio/littlelf/elf_symbol_section.hh
index 8dcb132..3f7d4fc 100644
--- a/src/clients/reconcilio/littlelf/elf_symbol_section.hh
+++ b/src/clients/reconcilio/littlelf/elf_symbol_section.hh
@@ -4,8 +4,7 @@
#include "elf_sections.hh"
#include <paludis/util/private_implementation_pattern.hh>
-
-#include <libwrapiter/libwrapiter_forward_iterator-fwd.hh>
+#include <paludis/util/wrapped_forward_iterator-fwd.hh>
#include <iosfwd>
@@ -77,7 +76,7 @@ class SymbolSection :
void resolve_symbols(Section<ElfType_> &);
- typedef libwrapiter::ForwardIterator<SymbolSection, const Symbol<ElfType_ > > SymbolIterator;
+ typedef paludis::WrappedForwardIterator<enum SymbolIteratorTag { }, const Symbol<ElfType_ > > SymbolIterator;
SymbolIterator symbol_begin() const;
SymbolIterator symbol_end() const;
};
diff --git a/src/clients/reconcilio/util/wildcard_expander.cc b/src/clients/reconcilio/util/wildcard_expander.cc
index ede51c4..b882929 100644
--- a/src/clients/reconcilio/util/wildcard_expander.cc
+++ b/src/clients/reconcilio/util/wildcard_expander.cc
@@ -140,7 +140,7 @@ WildcardExpander::~WildcardExpander()
{
}
-const WildcardExpander &
+WildcardExpander &
WildcardExpander::operator= (const WildcardExpander & other)
{
_imp->files = other._imp->files;
diff --git a/src/clients/reconcilio/util/wildcard_expander.hh b/src/clients/reconcilio/util/wildcard_expander.hh
index 47d8ce7..2c93db2 100644
--- a/src/clients/reconcilio/util/wildcard_expander.hh
+++ b/src/clients/reconcilio/util/wildcard_expander.hh
@@ -45,7 +45,7 @@ class PALUDIS_VISIBLE WildcardExpander :
~WildcardExpander();
- const WildcardExpander & operator= (const WildcardExpander &);
+ WildcardExpander & operator= (const WildcardExpander &);
const paludis::FSEntry & operator* () const PALUDIS_ATTRIBUTE((warn_unused_result));
const paludis::FSEntry * operator-> () const PALUDIS_ATTRIBUTE((warn_unused_result));
diff --git a/src/output/console_install_task.cc b/src/output/console_install_task.cc
index ab0a0ca..f6ddcd2 100644
--- a/src/output/console_install_task.cc
+++ b/src/output/console_install_task.cc
@@ -29,11 +29,11 @@
#include <paludis/util/mutex.hh>
#include <paludis/util/join.hh>
#include <paludis/util/set-impl.hh>
-#include <paludis/util/iterator.hh>
#include <paludis/util/visitor-impl.hh>
#include <paludis/util/tr1_functional.hh>
#include <paludis/util/fd_output_stream.hh>
#include <paludis/util/system.hh>
+#include <paludis/util/iterator_funcs.hh>
#include <paludis/query.hh>
#include <paludis/action.hh>
#include <paludis/repository.hh>
@@ -44,9 +44,6 @@
#include <paludis/hook.hh>
#include <paludis/fuzzy_finder.hh>
-#include <libwrapiter/libwrapiter_forward_iterator.hh>
-#include <libwrapiter/libwrapiter_output_iterator.hh>
-
#include <algorithm>
#include <set>
#include <list>
diff --git a/src/output/console_install_task.hh b/src/output/console_install_task.hh
index 3d3e867..dd83ef5 100644
--- a/src/output/console_install_task.hh
+++ b/src/output/console_install_task.hh
@@ -22,7 +22,6 @@
#include <paludis/install_task.hh>
#include <paludis/util/set.hh>
-#include <libwrapiter/libwrapiter_forward_iterator.hh>
#include <src/output/console_task.hh>
#include <iosfwd>
diff --git a/src/output/console_query_task.cc b/src/output/console_query_task.cc
index 76ea45b..ca82bd9 100644
--- a/src/output/console_query_task.cc
+++ b/src/output/console_query_task.cc
@@ -29,8 +29,6 @@
#include <paludis/util/map-impl.hh>
#include <paludis/util/join.hh>
#include <paludis/util/strip.hh>
-#include <libwrapiter/libwrapiter_forward_iterator.hh>
-#include <libwrapiter/libwrapiter_output_iterator.hh>
#include <paludis/query.hh>
#include <paludis/mask.hh>
#include <paludis/metadata_key.hh>
diff --git a/src/output/mask_displayer.cc b/src/output/mask_displayer.cc
index 40da239..0c2db4e 100644
--- a/src/output/mask_displayer.cc
+++ b/src/output/mask_displayer.cc
@@ -25,10 +25,8 @@
#include <paludis/util/sequence.hh>
#include <paludis/util/set.hh>
#include <paludis/util/visitor-impl.hh>
-#include <paludis/util/iterator.hh>
#include <paludis/util/visitor-impl.hh>
#include <paludis/metadata_key.hh>
-#include <libwrapiter/libwrapiter_forward_iterator.hh>
#include <sstream>
using namespace paludis;