aboutsummaryrefslogtreecommitdiff
path: root/paludis/package_id.cc
diff options
context:
space:
mode:
authorAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2007-11-17 12:33:54 +0000
committerAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2007-11-17 12:33:54 +0000
commit763dc12ae16b75aed6a97b16514f6583feef6663 (patch)
treeffebfd6e8acf7c8ebaa280dde1ca1ebdde6a7141 /paludis/package_id.cc
parent34fe5458d12f8c1d7893a89e59a4d2e5f8095980 (diff)
downloadpaludis-763dc12ae16b75aed6a97b16514f6583feef6663.tar.gz
paludis-763dc12ae16b75aed6a97b16514f6583feef6663.tar.xz
Be kinder to stupid compilers: don't rely upon tr1::shared_ptr<> being callable. Don't explicitly instantiate fully specialised templates if the compielr doesn't allow it. Include -impl headers in more places to work around compilers thinking they can ignore explicit instantiations.
Diffstat (limited to 'paludis/package_id.cc')
-rw-r--r--paludis/package_id.cc15
1 files changed, 12 insertions, 3 deletions
diff --git a/paludis/package_id.cc b/paludis/package_id.cc
index 573bab0e6..02f85d58a 100644
--- a/paludis/package_id.cc
+++ b/paludis/package_id.cc
@@ -26,6 +26,7 @@
#include <paludis/util/set.hh>
#include <paludis/util/set-impl.hh>
#include <paludis/util/stringify.hh>
+#include <paludis/util/indirect_iterator-impl.hh>
#include <paludis/util/wrapped_forward_iterator-impl.hh>
#include <paludis/util/wrapped_output_iterator-impl.hh>
#include <paludis/name.hh>
@@ -80,7 +81,7 @@ PackageID::add_metadata_key(const tr1::shared_ptr<const MetadataKey> & k) const
{
using namespace tr1::placeholders;
- if (_imp->keys.end() != std::find_if(_imp->keys.begin(), _imp->keys.end(),
+ if (indirect_iterator(_imp->keys.end()) != std::find_if(indirect_iterator(_imp->keys.begin()), indirect_iterator(_imp->keys.end()),
tr1::bind(std::equal_to<std::string>(), k->raw_name(), tr1::bind(tr1::mem_fn(&MetadataKey::raw_name), _1))))
throw ConfigurationError("Tried to add duplicate key '" + k->raw_name() + "' to ID '" + stringify(*this) + "'");
@@ -139,8 +140,16 @@ PackageID::find_metadata(const std::string & s) const
using namespace tr1::placeholders;
need_keys_added();
- return std::find_if(begin_metadata(), end_metadata(),
- tr1::bind(std::equal_to<std::string>(), s, tr1::bind(tr1::mem_fn(&MetadataKey::raw_name), _1)));
+
+ // tr1::mem_fn on a sptr doesn't work with boost
+ // return std::find_if(begin_metadata(), end_metadata(),
+ // tr1::bind(std::equal_to<std::string>(), s, tr1::bind(tr1::mem_fn(&MetadataKey::raw_name), _1)));
+
+ for (MetadataConstIterator i(begin_metadata()), i_end(end_metadata()) ;
+ i != i_end ; ++i)
+ if ((*i)->raw_name() == s)
+ return i;
+ return end_metadata();
}
std::ostream &