This patch is really only what is left of the old iterator patch
series. And basically all the stuff that was dependant upon boost
1.31.0. 

I am not sure about the functor stuff herein, but the iterator adaptor
usage seems nice to me. Also the boost::next change is IMHO good.
(the deref is horrible, and I'll never apply that one...)

So if you have comments to this patch likes/dislikes I'd be happy to
receive them...

? BranchList_C.diff
? Config
? err.diff
? iterator-2.diff
? iterator-3.diff
? iterator-4.diff
? iterator-5.diff
? iterator-6.diff
? iterator-7.diff
? iterator.diff
? iters.diff
Index: src/BufferView_pimpl.C
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/BufferView_pimpl.C,v
retrieving revision 1.501
diff -u -p -b -r1.501 BufferView_pimpl.C
--- src/BufferView_pimpl.C	4 Feb 2004 11:23:23 -0000	1.501
+++ src/BufferView_pimpl.C	5 Feb 2004 16:19:48 -0000
@@ -753,7 +753,9 @@ InsetBase * BufferView::Pimpl::getInsetB
 		find_if(Buffer::inset_iterator(
 			cursorPar(), cursor().pos()),
 			buffer_->inset_iterator_end(),
-			lyx::compare_memfun(&Inset::lyxCode, code));
+			bind(equal_to<InsetOld::Code>(),
+			     bind(Inset::lyxCode, _1),
+			     code));
 	return it != buffer_->inset_iterator_end() ? (*it) : 0;
 #else
 	// Ok, this is a little bit too brute force but it
Index: src/MenuBackend.C
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/MenuBackend.C,v
retrieving revision 1.95
diff -u -p -b -r1.95 MenuBackend.C
--- src/MenuBackend.C	31 Jan 2004 15:30:20 -0000	1.95
+++ src/MenuBackend.C	5 Feb 2004 16:19:49 -0000
@@ -44,6 +44,7 @@
 #include "support/tostr.h"
 
 #include <boost/bind.hpp>
+#include <boost/iterator/transform_iterator.hpp>
 
 #include <algorithm>
 
@@ -53,11 +54,14 @@ using lyx::support::MakeDisplayPath;
 using lyx::support::token;
 
 using boost::bind;
+using boost::make_transform_iterator;
 
 using std::auto_ptr;
 using std::endl;
 using std::equal_to;
+using std::find;
 using std::find_if;
+using std::less;
 using std::max;
 using std::sort;
 using std::string;
@@ -383,13 +387,6 @@ void Menu::checkShortcuts() const
 
 namespace {
 
-class compare_format {
-public:
-	bool operator()(Format const * p1, Format const * p2) {
-		return *p1 < *p2;
-	}
-};
-
 string const limit_string_length(string const & str)
 {
 	string::size_type const max_item_length = 45;
@@ -440,6 +437,15 @@ void expandDocuments(Menu & tomenu, LyXV
 }
 
 
+// Helper function. Should be placed in support. (Lgb)
+// Does the standard or boost have anyting like this? (Lgb)
+template <typename Type>
+Type const & deref(Type const * t)
+{
+	return *t;
+}
+
+
 void expandFormats(MenuItem::Kind kind, Menu & tomenu, LyXView const * view)
 {
 	if (!view->buffer() && kind != MenuItem::ImportFormats) {
@@ -471,7 +477,11 @@ void expandFormats(MenuItem::Kind kind, 
 		formats = Exporter::GetExportableFormats(*view->buffer(), false);
 		action = LFUN_EXPORT;
 	}
-	sort(formats.begin(), formats.end(), compare_format());
+
+	sort(formats.begin(), formats.end(),
+	     bind(less<Format>(),
+		  bind(deref<Format>, _1),
+		  bind(deref<Format>, _2)));
 
 	Formats::const_iterator fit = formats.begin();
 	Formats::const_iterator end = formats.end();
@@ -790,22 +800,13 @@ void MenuBackend::expand(Menu const & fr
 
 bool Menu::hasSubmenu(string const & name) const
 {
-#if 1
-	return find_if(begin(), end(),
-		       bind(std::equal_to<string>(),
-			    bind(&MenuItem::submenuname, _1),
-			    name)) != end();
-#else
-	// I would have prefered this, but I am not sure if it
-	// makes a difference. (Lgb)
-	return find_if(
+	return find(
 		make_transform_iterator(begin(),
 					bind(&MenuItem::submenuname, _1)),
 		make_transform_iterator(end(),
 					bind(&MenuItem::submenuname, _1)),
 		name
 		).base() != end();
-#endif
 }
 
 
Index: src/bufferlist.C
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/bufferlist.C,v
retrieving revision 1.140
diff -u -p -b -r1.140 bufferlist.C
--- src/bufferlist.C	31 Jan 2004 15:30:20 -0000	1.140
+++ src/bufferlist.C	5 Feb 2004 16:19:49 -0000
@@ -26,9 +26,11 @@
 #include "frontends/Alert.h"
 
 #include "support/filetools.h"
-#include "support/lyxfunctional.h"
 
 #include <boost/bind.hpp>
+#include <boost/function_output_iterator.hpp>
+#include <boost/iterator/transform_iterator.hpp>
+
 
 using lyx::support::AddName;
 using lyx::support::bformat;
@@ -40,9 +42,11 @@ using lyx::support::removeAutosaveFile;
 using lyx::support::prefixIs;
 
 using boost::bind;
+using boost::make_transform_iterator;
 
 using std::auto_ptr;
 using std::endl;
+using std::equal_to;
 using std::find;
 using std::find_if;
 using std::for_each;
@@ -193,9 +197,13 @@ bool BufferList::close(Buffer * buf, boo
 
 vector<string> const BufferList::getFileNames() const
 {
-	vector<string> nvec;
-	std::copy(bstore.begin(), bstore.end(),
-		  lyx::back_inserter_fun(nvec, &Buffer::fileName));
+	vector<string> nvec(
+		make_transform_iterator(bstore.begin(),
+					bind(&Buffer::fileName, _1)),
+		make_transform_iterator(bstore.end(),
+					bind(&Buffer::fileName, _1))
+		);
+
 	return nvec;
 }
 
@@ -302,8 +310,9 @@ void BufferList::emergencyWrite(Buffer *
 bool BufferList::exists(string const & s) const
 {
 	return find_if(bstore.begin(), bstore.end(),
-		       lyx::compare_memfun(&Buffer::fileName, s))
-		!= bstore.end();
+		       bind(equal_to<string>(),
+			    bind(&Buffer::fileName, _1),
+			    s)) != bstore.end();
 }
 
 
@@ -320,7 +329,9 @@ Buffer * BufferList::getBuffer(string co
 {
 	BufferStorage::iterator it =
 		find_if(bstore.begin(), bstore.end(),
-			lyx::compare_memfun(&Buffer::fileName, s));
+			bind(equal_to<string>(),
+			     bind(&Buffer::fileName, _1),
+			     s));
 	return it != bstore.end() ? (*it) : 0;
 }
 
Index: src/converter.C
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/converter.C,v
retrieving revision 1.96
diff -u -p -b -r1.96 converter.C
--- src/converter.C	31 Jan 2004 15:30:20 -0000	1.96
+++ src/converter.C	5 Feb 2004 16:19:49 -0000
@@ -27,6 +27,7 @@
 #include "support/path.h"
 #include "support/systemcall.h"
 
+
 using lyx::support::AddName;
 using lyx::support::bformat;
 using lyx::support::ChangeExtension;
@@ -507,10 +508,10 @@ bool Converters::scanLog(Buffer const & 
 
 namespace {
 
-class showMessage : public boost::signals::trackable {
+class showMessage : public std::unary_function<string, void>, public boost::signals::trackable {
 public:
 	showMessage(Buffer const & b) : buffer_(b) {};
-	void operator()(string const & m)
+	void operator()(string const & m) const
 	{
 		buffer_.message(m);
 	}
Index: src/format.C
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/format.C,v
retrieving revision 1.21
diff -u -p -b -r1.21 format.C
--- src/format.C	31 Jan 2004 15:30:21 -0000	1.21
+++ src/format.C	5 Feb 2004 16:19:49 -0000
@@ -24,6 +24,7 @@
 #include "support/path.h"
 #include "support/systemcall.h"
 
+
 using lyx::support::bformat;
 using lyx::support::compare_ascii_no_case;
 using lyx::support::contains;
Index: src/lyxlex_pimpl.C
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/lyxlex_pimpl.C,v
retrieving revision 1.42
diff -u -p -b -r1.42 lyxlex_pimpl.C
--- src/lyxlex_pimpl.C	31 Jan 2004 15:30:21 -0000	1.42
+++ src/lyxlex_pimpl.C	5 Feb 2004 16:19:49 -0000
@@ -20,6 +20,7 @@
 #include "support/lyxalgo.h"
 #include "support/lstrings.h"
 
+
 using lyx::support::compare_ascii_no_case;
 using lyx::support::getExtFromContents;
 using lyx::support::MakeDisplayPath;
@@ -37,9 +38,12 @@ using std::ostream;
 
 namespace {
 
-struct compare_tags : public std::binary_function<keyword_item, keyword_item, int> {
+struct compare_tags
+	: public std::binary_function<keyword_item, keyword_item, bool>
+{
 	// used by lower_bound, sort and sorted
-	int operator()(keyword_item const & a, keyword_item const & b) const {
+	bool operator()(keyword_item const & a, keyword_item const & b) const
+	{
 		// we use the ascii version, because in turkish, 'i'
 		// is not the lowercase version of 'I', and thus
 		// turkish locale breaks parsing of tags.
Index: src/lyxtextclass.C
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/lyxtextclass.C,v
retrieving revision 1.46
diff -u -p -b -r1.46 lyxtextclass.C
--- src/lyxtextclass.C	31 Jan 2004 15:30:21 -0000	1.46
+++ src/lyxtextclass.C	5 Feb 2004 16:19:49 -0000
@@ -24,11 +24,16 @@
 #include "support/lstrings.h"
 #include "support/filetools.h"
 
+#include <boost/iterator/indirect_iterator.hpp>
+
+
 using lyx::support::LibFileSearch;
 using lyx::support::MakeDisplayPath;
 using lyx::support::rtrim;
 using lyx::support::subst;
 
+using boost::make_indirect_iterator;
+
 using std::endl;
 using std::find_if;
 using std::remove_if;
@@ -38,14 +43,14 @@ using std::ostream;
 
 namespace {
 
-class LayoutNamesEqual : public std::unary_function<LyXLayout_ptr, bool> {
+class LayoutNamesEqual : public std::unary_function<LyXLayout, bool> {
 public:
 	LayoutNamesEqual(string const & name)
 		: name_(name)
 	{}
-	bool operator()(LyXLayout_ptr const & c) const
+	bool operator()(LyXLayout const & ll) const
 	{
-		return c->name() == name_;
+		return ll.name() == name_;
 	}
 private:
 	string name_;
@@ -788,9 +793,9 @@ bool LyXTextClass::hasLayout(string cons
 {
 	string const name = (n.empty() ? defaultLayoutName() : n);
 
-	return find_if(layoutlist_.begin(), layoutlist_.end(),
-		       LayoutNamesEqual(name))
-		!= layoutlist_.end();
+	return find_if(make_indirect_iterator(layoutlist_.begin()),
+		       make_indirect_iterator(layoutlist_.end()),
+		       LayoutNamesEqual(name)).base() != layoutlist_.end();
 }
 
 
@@ -799,18 +804,20 @@ LyXLayout_ptr const & LyXTextClass::oper
 {
 	BOOST_ASSERT(!name.empty());
 
+	LayoutList::const_iterator beg = layoutlist_.begin();
+	LayoutList::const_iterator end = layoutlist_.end();
 	LayoutList::const_iterator cit =
-		find_if(layoutlist_.begin(),
-			layoutlist_.end(),
-			LayoutNamesEqual(name));
+		find_if(make_indirect_iterator(beg),
+			make_indirect_iterator(end),
+			LayoutNamesEqual(name)).base();
 
-	if (cit == layoutlist_.end()) {
+	if (cit == end) {
 		lyxerr << "We failed to find the layout '" << name
 		       << "' in the layout list. You MUST investigate!"
 		       << endl;
-		for (LayoutList::const_iterator it = layoutlist_.begin();
-		         it != layoutlist_.end(); ++it)
-			lyxerr  << " " << it->get()->name() << endl;
+		for (LayoutList::const_iterator it = beg;
+		     it != end; ++it)
+			lyxerr  << " " << (*it)->name() << endl;
 
 		// we require the name to exist
 		BOOST_ASSERT(false);
@@ -826,14 +833,16 @@ bool LyXTextClass::delete_layout(string 
 	if (name == defaultLayoutName())
 		return false;
 
-	LayoutList::iterator it =
-		remove_if(layoutlist_.begin(), layoutlist_.end(),
-			  LayoutNamesEqual(name));
-
+	LayoutList::iterator beg = layoutlist_.begin();
 	LayoutList::iterator end = layoutlist_.end();
-	bool const ret = (it != end);
-	layoutlist_.erase(it, end);
-	return ret;
+
+	LayoutList::iterator it =
+		layoutlist_.erase(
+			remove_if(make_indirect_iterator(beg),
+				  make_indirect_iterator(end),
+				  LayoutNamesEqual(name)).base(),
+			end);
+	return it != end;
 }
 
 
Index: src/lyxtextclasslist.C
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/lyxtextclasslist.C,v
retrieving revision 1.20
diff -u -p -b -r1.20 lyxtextclasslist.C
--- src/lyxtextclasslist.C	31 Jan 2004 15:30:21 -0000	1.20
+++ src/lyxtextclasslist.C	5 Feb 2004 16:19:49 -0000
@@ -16,18 +16,22 @@
 #include "debug.h"
 #include "lyxlex.h"
 
-#include "support/lyxfunctional.h"
 #include "support/filetools.h"
 
+#include <boost/bind.hpp>
+
 using lyx::textclass_type;
 
 using lyx::support::LibFileSearch;
 using lyx::support::MakeDisplayPath;
 
+using boost::bind;
+
 #ifndef CXX_GLOBAL_CSTD
 using std::exit;
 #endif
 
+using std::equal_to;
 using std::endl;
 using std::find_if;
 using std::make_pair;
@@ -42,7 +46,9 @@ LyXTextClassList::NumberOfClass(string c
 {
 	ClassList::const_iterator cit =
 		find_if(classlist_.begin(), classlist_.end(),
-			lyx::compare_memfun(&LyXTextClass::name, textclass));
+			bind(equal_to<string>(),
+			     bind(&LyXTextClass::name, _1),
+			     textclass));
 	return cit != classlist_.end() ?
 		make_pair(true, textclass_type(cit - classlist_.begin())) :
 		make_pair(false, textclass_type(0));
Index: src/paragraph_pimpl.C
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/paragraph_pimpl.C,v
retrieving revision 1.93
diff -u -p -b -r1.93 paragraph_pimpl.C
--- src/paragraph_pimpl.C	26 Jan 2004 10:13:09 -0000	1.93
+++ src/paragraph_pimpl.C	5 Feb 2004 16:19:50 -0000
@@ -26,11 +26,17 @@
 #include "outputparams.h"
 #include "texrow.h"
 
+#include <boost/bind.hpp>
+#include <boost/iterator/transform_iterator.hpp>
 
 using lyx::pos_type;
 
+using boost::bind;
+using boost::make_transform_iterator;
+
 using std::endl;
 using std::upper_bound;
+using std::less;
 using std::lower_bound;
 using std::string;
 using std::ostream;
@@ -275,11 +281,23 @@ void Paragraph::Pimpl::insertChar(pos_ty
 
 	// Update the font table.
 	FontTable search_font(pos, LyXFont());
-	for (FontList::iterator it = lower_bound(fontlist.begin(),
+#if 1
+	FontList::iterator it =
+                lower_bound(fontlist.begin(),
 						      fontlist.end(),
-						      search_font, matchFT());
-	     it != fontlist.end(); ++it)
-	{
+			    search_font,
+			    bind(less<pos_type>(),
+				 bind(&FontTable::pos, _1),
+				 bind(&FontTable::pos, _2)));
+#else
+	FontList::iterator it = lower_bound(
+		make_transform_iterator(fontlist.begin(), 
+					bind(&FontTable::pos, _1)),
+		make_transform_iterator(fontlist.begin(),
+					bind(&FontTable::pos, _1)), 
+		pos);
+#endif
+	for (; it != fontlist.end(); ++it) {
 		it->pos(it->pos() + 1);
 	}
 
@@ -319,10 +337,23 @@ void Paragraph::Pimpl::eraseIntern(pos_t
 	// Erase entries in the tables.
 	FontTable search_font(pos, LyXFont());
 
+#if 1
 	FontList::iterator it =
 		lower_bound(fontlist.begin(),
 			    fontlist.end(),
-			    search_font, matchFT());
+			    search_font,
+			    bind(less<pos_type>(),
+				 bind(&FontTable::pos, _1),
+				 bind(&FontTable::pos, _2)));
+#else
+	FontList::iterator it =
+		find_if(fontlist.begin(),
+			    fontlist.end(),
+			    search_font,
+			    bind(less<pos_type>(),
+				 bind(&FontTable::pos, _1),
+				 bind(&FontTable::pos, _2)));
+#endif
 	if (it != fontlist.end() && it->pos() == pos &&
 	    (pos == 0 ||
 	     (it != fontlist.begin()
Index: src/paragraph_pimpl.h
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/paragraph_pimpl.h,v
retrieving revision 1.42
diff -u -p -b -r1.42 paragraph_pimpl.h
--- src/paragraph_pimpl.h	26 Jan 2004 10:13:09 -0000	1.42
+++ src/paragraph_pimpl.h	5 Feb 2004 16:19:50 -0000
@@ -122,16 +122,6 @@ struct Paragraph::Pimpl {
 		///
 		static ShareContainer<LyXFont> container;
 	};
-	///
-	friend struct matchFT;
-	///
-	struct matchFT {
-		/// used by lower_bound and upper_bound
-		inline
-		int operator()(FontTable const & a, FontTable const & b) const {
-			return a.pos() < b.pos();
-		}
-	};
 
 	///
 	typedef std::vector<FontTable> FontList;
Index: src/texrow.C
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/texrow.C,v
retrieving revision 1.32
diff -u -p -b -r1.32 texrow.C
--- src/texrow.C	8 Sep 2003 00:33:25 -0000	1.32
+++ src/texrow.C	5 Feb 2004 16:19:50 -0000
@@ -15,26 +15,14 @@
 #include "texrow.h"
 #include "debug.h"
 
-#include <algorithm>
-
-using std::find_if;
+#include <boost/bind.hpp>
 
+#include <algorithm>
 
-namespace {
-
-/// function object returning true when row number is found
-class same_rownumber {
-public:
-	same_rownumber(int row) : row_(row) {}
-	bool operator()(TexRow::RowList::value_type const & vt) const {
-		return vt.rownumber() == row_;
-	}
-
-private:
-	int row_;
-};
+using boost::bind;
 
-} // namespace anon
+using std::equal_to;
+using std::find_if;
 
 
 void TexRow::reset()
@@ -65,7 +53,9 @@ bool TexRow::getIdFromRow(int row, int &
 {
 	RowList::const_iterator cit =
 		find_if(rowlist.begin(), rowlist.end(),
-			same_rownumber(row));
+			bind(equal_to<int>(),
+			     bind(&RowList::value_type::rownumber, _1),
+			     row));
 
 	if (cit != rowlist.end()) {
 		id = cit->id();
Index: src/text.C
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/text.C,v
retrieving revision 1.530
diff -u -p -b -r1.530 text.C
--- src/text.C	3 Feb 2004 08:56:23 -0000	1.530
+++ src/text.C	5 Feb 2004 16:19:50 -0000
@@ -1409,8 +1409,7 @@ ParagraphList::iterator LyXText::getPar(
 	BOOST_ASSERT(par >= 0);
 	BOOST_ASSERT(par < int(paragraphs().size()));
 	ParagraphList::iterator pit = paragraphs().begin();
-	advance(pit, par);
-	return pit;
+	return boost::next(pit, par);
 }
 
 
Index: src/text2.C
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/text2.C,v
retrieving revision 1.539
diff -u -p -b -r1.539 text2.C
Index: src/frontends/controllers/ControlCommandBuffer.C
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/frontends/controllers/ControlCommandBuffer.C,v
retrieving revision 1.19
diff -u -p -b -r1.19 ControlCommandBuffer.C
--- src/frontends/controllers/ControlCommandBuffer.C	17 Oct 2003 18:01:12 -0000	1.19
+++ src/frontends/controllers/ControlCommandBuffer.C	5 Feb 2004 16:19:51 -0000
@@ -19,38 +19,34 @@
 #include "funcrequest.h"
 
 #include "frontends/LyXView.h"
-#include "support/lyxalgo.h"
 #include "support/lstrings.h"
 
+#include <boost/bind.hpp>
+#include <boost/iterator/filter_iterator.hpp>
+#include <boost/iterator/transform_iterator.hpp>
+
 using bv_funcs::currentState;
 
 using lyx::support::prefixIs;
 
-using std::back_inserter;
-using std::transform;
+using boost::bind;
+using boost::make_filter_iterator;
+using boost::make_transform_iterator;
+
 using std::string;
 using std::vector;
 
 
-namespace {
-
-struct prefix_p {
-	string p;
-	prefix_p(string const & s)
-		: p(s) {}
-	bool operator()(string const & s) const {
-		return prefixIs(s, p);
-	}
-};
-
-} // end of anon namespace
-
-
 ControlCommandBuffer::ControlCommandBuffer(LyXView & lv)
 	: lv_(lv), history_pos_(history_.end())
 {
-	transform(lyxaction.func_begin(), lyxaction.func_end(),
-		back_inserter(commands_), lyx::firster());
+	typedef LyXAction::func_map::value_type Pair;
+	
+	commands_.assign(
+		make_transform_iterator(lyxaction.func_begin(),
+					bind(&Pair::first, _1)),
+		make_transform_iterator(lyxaction.func_end(),
+					bind(&Pair::first, _1)));
 }
 
 
@@ -83,10 +79,12 @@ string const ControlCommandBuffer::getCu
 vector<string> const
 ControlCommandBuffer::completions(string const & prefix, string & new_prefix)
 {
-	vector<string> comp;
-
-	lyx::copy_if(commands_.begin(), commands_.end(),
-		back_inserter(comp), prefix_p(prefix));
+	vector<string> comp(make_filter_iterator(bind(prefixIs, _1, prefix),
+						 commands_.begin(),
+						 commands_.end()),
+			    make_filter_iterator(bind(prefixIs, _1, prefix),
+						 commands_.begin(),
+						 commands_.end()));
 
 	if (comp.empty()) {
 		new_prefix = prefix;
@@ -104,9 +102,13 @@ ControlCommandBuffer::completions(string
 	if (tmp.length() > test.length())
 		test += tmp[test.length()];
 	while (test.length() < tmp.length()) {
-		vector<string> vtmp;
-		lyx::copy_if(comp.begin(), comp.end(),
-			back_inserter(vtmp), prefix_p(test));
+		vector<string> vtmp(
+			make_filter_iterator(bind(prefixIs, _1, test),
+					     comp.begin(),
+					     comp.end()),
+			make_filter_iterator(bind(prefixIs, _1, test),
+					     comp.begin(),
+					     comp.end()));
 		if (vtmp.size() != comp.size()) {
 			test.erase(test.length() - 1);
 			break;
Index: src/frontends/controllers/ControlExternal.C
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/frontends/controllers/ControlExternal.C,v
retrieving revision 1.55
diff -u -p -b -r1.55 ControlExternal.C
--- src/frontends/controllers/ControlExternal.C	28 Jan 2004 16:21:26 -0000	1.55
+++ src/frontends/controllers/ControlExternal.C	5 Feb 2004 16:19:51 -0000
@@ -130,9 +130,7 @@ int ControlExternal::getTemplateNumber(s
 external::Template ControlExternal::getTemplate(int i) const
 {
 	external::TemplateManager::Templates::const_iterator i1
-		= external::TemplateManager::get().getTemplates().begin();
-
-	advance(i1, i);
+		= boost::next(external::TemplateManager::get().getTemplates().begin(), i);
 
 	return i1->second;
 }
Index: src/frontends/controllers/biblio.C
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/frontends/controllers/biblio.C,v
retrieving revision 1.61
diff -u -p -b -r1.61 biblio.C
--- src/frontends/controllers/biblio.C	1 Feb 2004 12:46:11 -0000	1.61
+++ src/frontends/controllers/biblio.C	5 Feb 2004 16:19:51 -0000
@@ -18,6 +18,7 @@
 
 #include "support/lstrings.h"
 
+#include <boost/bind.hpp>
 #include <boost/regex.hpp>
 
 #include <algorithm>
@@ -34,6 +35,9 @@ using lyx::support::subst;
 using lyx::support::token;
 using lyx::support::trim;
 
+using boost::bind;
+
+using std::less;
 using std::string;
 using std::ostringstream;
 using std::vector;
@@ -154,19 +158,6 @@ string const getYear(InfoMap const & map
 }
 
 
-namespace {
-
-// A functor for use with std::sort, leading to case insensitive sorting
-struct compareNoCase: public std::binary_function<string, string, bool>
-{
-	bool operator()(string const & s1, string const & s2) const {
-		return compare_ascii_no_case(s1, s2) < 0;
-	}
-};
-
-} // namespace anon
-
-
 vector<string> const getKeys(InfoMap const & map)
 {
 	vector<string> bibkeys;
@@ -176,7 +167,11 @@ vector<string> const getKeys(InfoMap con
 		bibkeys.push_back(it->first);
 	}
 
-	std::sort(bibkeys.begin(), bibkeys.end(), compareNoCase());
+	// Do a no-case-sensitive sort
+	std::sort(bibkeys.begin(), bibkeys.end(),
+		  bind(less<int>(),
+		       bind(compare_ascii_no_case, _1, _2),
+		       0));
 	return bibkeys;
 }
 
Index: src/frontends/controllers/frnt_lang.C
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/frontends/controllers/frnt_lang.C,v
retrieving revision 1.15
diff -u -p -b -r1.15 frnt_lang.C
--- src/frontends/controllers/frnt_lang.C	31 Jan 2004 15:30:23 -0000	1.15
+++ src/frontends/controllers/frnt_lang.C	5 Feb 2004 16:19:51 -0000
@@ -15,27 +15,18 @@
 #include "gettext.h"
 #include "language.h"
 
+#include <boost/bind.hpp>
+
 #include <algorithm>
 
 
+using boost::bind;
+
+using std::less;
 using std::string;
 using std::vector;
 
 
-namespace {
-
-struct Sorter
-	: public std::binary_function<frnt::LanguagePair,
-				      frnt::LanguagePair, bool>
-{
-	bool operator()(frnt::LanguagePair const & lhs,
-			frnt::LanguagePair const & rhs) const {
-		return lhs.first < rhs.first;
-	}
-};
-
-} // namespace anon
-
 namespace frnt {
 
 vector<LanguagePair> const getLanguageData(bool character_dlg)
@@ -64,7 +55,10 @@ vector<LanguagePair> const getLanguageDa
 	vector<LanguagePair>::iterator begin = character_dlg ?
 		langs.begin() + 2 : langs.begin();
 
-	std::sort(begin, langs.end(), Sorter());
+	std::sort(begin, langs.end(),
+		  bind(less<string>(),
+		       bind(&LanguagePair::first, _1),
+		       bind(&LanguagePair::first, _2)));
 
 	return langs;
 }
Index: src/frontends/controllers/helper_funcs.h
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/frontends/controllers/helper_funcs.h,v
retrieving revision 1.23
diff -u -p -b -r1.23 helper_funcs.h
--- src/frontends/controllers/helper_funcs.h	8 Jan 2004 10:59:49 -0000	1.23
+++ src/frontends/controllers/helper_funcs.h	5 Feb 2004 16:19:51 -0000
@@ -13,6 +13,8 @@
 #define HELPERFUNCS_H
 
 #include <boost/bind.hpp>
+#include <boost/iterator/transform_iterator.hpp>
+
 #include <utility>
 #include <vector>
 #include <string>
@@ -76,17 +78,16 @@ browseDir(std::string const & pathname,
 /// Returns a vector of units that can be used to create a valid LaTeX length.
 std::vector<std::string> const getLatexUnits();
 
-
-/** Functions to extract vectors of the first and second elems from a
-    vector<pair<A,B> >
-*/
 template<class Pair>
 std::vector<typename Pair::first_type> const
 getFirst(std::vector<Pair> const & pr)
 {
-	std::vector<typename Pair::first_type> tmp(pr.size());
-	std::transform(pr.begin(), pr.end(), tmp.begin(),
-		       boost::bind(&Pair::first, _1));
+	std::vector<typename Pair::first_type> tmp(
+		boost::make_transform_iterator(pr.begin(),
+					       boost::bind(&Pair::first, _1)),
+		boost::make_transform_iterator(pr.end(),
+					       boost::bind(&Pair::first, _1))
+		);
 	return tmp;
 }
 
@@ -94,9 +95,12 @@ template<class Pair>
 std::vector<typename Pair::second_type> const
 getSecond(std::vector<Pair> const & pr)
 {
-	std::vector<typename Pair::second_type> tmp(pr.size());
-	std::transform(pr.begin(), pr.end(), tmp.begin(),
-		       boost::bind(&Pair::second, _1));
+	std::vector<typename Pair::second_type> tmp(
+		boost::make_transform_iterator(pr.begin(),
+					       boost::bind(&Pair::second, _1)),
+		boost::make_transform_iterator(pr.end(),
+					       boost::bind(&Pair::second, _1))
+		);
 	return tmp;
 }
 
Index: src/frontends/gnome/Dialogs3.C
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/frontends/gnome/Dialogs3.C,v
retrieving revision 1.2
diff -u -p -b -r1.2 Dialogs3.C
--- src/frontends/gnome/Dialogs3.C	23 Aug 2003 00:16:37 -0000	1.2
+++ src/frontends/gnome/Dialogs3.C	5 Feb 2004 16:19:51 -0000
@@ -49,6 +49,11 @@
 #include "gnomeBC.h"
 #include "ButtonController.h"
 
+#include <boost/bind.hpp>
+
+using boost::bind;
+
+using std::equal_to;
 
 typedef ButtonController<OkCancelPolicy, gnomeBC>
 	OkCancelBC;
@@ -69,23 +74,15 @@ char const * const dialognames[] = { "bi
 char const * const * const end_dialognames =
 	dialognames + (sizeof(dialognames) / sizeof(char *));
 
-struct cmpCStr {
-	cmpCStr(char const * name) : name_(name) {}
-	bool operator()(char const * other) {
-		return strcmp(other, name_) == 0;
-	}
-private:
-	char const * name_;
-};
-
-
 } // namespace anon
 
 
 bool Dialogs::isValidName(string const & name) const
 {
  	return std::find_if(dialognames, end_dialognames,
-			    cmpCStr(name.c_str())) != end_dialognames;
+			    bind(equal_to<string>(),
+				 _1,
+				 name)) != end_dialognames;
 }
 
 
Index: src/frontends/gtk/Dialogs.C
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/frontends/gtk/Dialogs.C,v
retrieving revision 1.8
diff -u -p -b -r1.8 Dialogs.C
--- src/frontends/gtk/Dialogs.C	20 Dec 2003 18:47:35 -0000	1.8
+++ src/frontends/gtk/Dialogs.C	5 Feb 2004 16:19:51 -0000
@@ -95,8 +95,13 @@
 #include "ams_nrel.xbm"
 #include "ams_ops.xbm"
 
+#include <boost/bind.hpp>
+
 #include <vector>
 
+using boost::bind;
+
+using std::equal_to;
 using std::string;
 
 
@@ -128,22 +133,15 @@ char const * const dialognames[] = { "ab
 char const * const * const end_dialognames =
 	dialognames + (sizeof(dialognames) / sizeof(char *));
 
-struct cmpCStr {
-	cmpCStr(char const * name) : name_(name) {}
-	bool operator()(char const * other) {
-		return strcmp(other, name_) == 0;
-	}
-private:
-	char const * name_;
-};
-
 } // namespace anon
 
 
 bool Dialogs::isValidName(string const & name) const
 {
 	return std::find_if(dialognames, end_dialognames,
-			    cmpCStr(name.c_str())) != end_dialognames;
+			    bind(equal_to<string>(),
+				 _1,
+				 name)) != end_dialognames;
 }
 
 
Index: src/frontends/qt2/Dialogs.C
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/frontends/qt2/Dialogs.C,v
retrieving revision 1.102
diff -u -p -b -r1.102 Dialogs.C
--- src/frontends/qt2/Dialogs.C	26 Jan 2004 00:43:56 -0000	1.102
+++ src/frontends/qt2/Dialogs.C	5 Feb 2004 16:19:51 -0000
@@ -81,6 +81,11 @@
 
 #include "qt_helpers.h"
 
+#include <boost/bind.hpp>
+
+using boost::bind;
+
+using std::equal_to;
 using std::string;
 
 
@@ -102,23 +107,15 @@ char const * const dialognames[] = {
 char const * const * const end_dialognames =
 	dialognames + (sizeof(dialognames) / sizeof(char *));
 
-struct cmpCStr {
-	cmpCStr(char const * name) : name_(name) {}
-	bool operator()(char const * other) {
-		return strcmp(other, name_) == 0;
-	}
-private:
-	char const * name_;
-};
-
-
 } // namespace anon
 
 
 bool Dialogs::isValidName(string const & name) const
 {
 	return std::find_if(dialognames, end_dialognames,
-			    cmpCStr(name.c_str())) != end_dialognames;
+			    bind(equal_to<string>(),
+				 _1,
+				 name)) != end_dialognames;
 }
 
 
Index: src/frontends/qt2/QLImage.C
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/frontends/qt2/QLImage.C,v
retrieving revision 1.29
diff -u -p -b -r1.29 QLImage.C
--- src/frontends/qt2/QLImage.C	20 Nov 2003 01:22:51 -0000	1.29
+++ src/frontends/qt2/QLImage.C	5 Feb 2004 16:19:51 -0000
@@ -16,17 +16,20 @@
 #include "graphics/GraphicsParams.h"
 #include "format.h"
 #include "support/lstrings.h"       // lowercase
-#include "support/lyxfunctional.h"  // compare_memfun
 #include "qt_helpers.h"
 
 #include <qimage.h>
 #include <qpainter.h>
 
+#include <boost/bind.hpp>
 #include <boost/tuple/tuple.hpp>
 
 using lyx::support::lowercase;
 
+using boost::bind;
+
 using std::endl;
+using std::equal_to;
 using std::find_if;
 using std::string;
 
@@ -72,7 +75,10 @@ Image::FormatList QLImage::loadableForma
 			ext = "jpg";
 
 		Formats::const_iterator fit =
-			find_if(begin, end, lyx::compare_memfun(&Format::extension, ext));
+			find_if(begin, end,
+				bind(equal_to<string>(),
+				     bind(&Format::extension, _1),
+				     ext));
 		if (fit != end)
 			fmts.push_back(fit->name());
 	}
Index: src/frontends/xforms/Dialogs.C
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/frontends/xforms/Dialogs.C,v
retrieving revision 1.123
diff -u -p -b -r1.123 Dialogs.C
--- src/frontends/xforms/Dialogs.C	26 Jan 2004 00:43:56 -0000	1.123
+++ src/frontends/xforms/Dialogs.C	5 Feb 2004 16:19:52 -0000
@@ -97,7 +97,11 @@
 #include "ams_nrel.xbm"
 #include "ams_ops.xbm"
 
+#include <boost/bind.hpp>
 
+using boost::bind;
+
+using std::equal_to;
 using std::string;
 
 
@@ -130,22 +134,15 @@ char const * const dialognames[] = {
 char const * const * const end_dialognames =
 	dialognames + (sizeof(dialognames) / sizeof(char *));
 
-struct cmpCStr {
-	cmpCStr(char const * name) : name_(name) {}
-	bool operator()(char const * other) {
-		return strcmp(other, name_) == 0;
-	}
-private:
-	char const * name_;
-};
-
 } // namespace anon
 
 
 bool Dialogs::isValidName(string const & name) const
 {
 	return std::find_if(dialognames, end_dialognames,
-			    cmpCStr(name.c_str())) != end_dialognames;
+			    bind(equal_to<string>(),
+				 _1,
+				 name)) != end_dialognames;
 }
 
 
Index: src/frontends/xforms/FormDocument.C
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/frontends/xforms/FormDocument.C,v
retrieving revision 1.165
diff -u -p -b -r1.165 FormDocument.C
--- src/frontends/xforms/FormDocument.C	1 Feb 2004 12:46:12 -0000	1.165
+++ src/frontends/xforms/FormDocument.C	5 Feb 2004 16:19:52 -0000
@@ -70,7 +70,6 @@ bool const scalableTabfolders = false;
 bool const scalableTabfolders = true;
 #endif
 
-
 } // namespace anon
 
 
Index: src/frontends/xforms/FormVSpace.C
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/frontends/xforms/FormVSpace.C,v
retrieving revision 1.7
diff -u -p -b -r1.7 FormVSpace.C
--- src/frontends/xforms/FormVSpace.C	1 Feb 2004 12:46:12 -0000	1.7
+++ src/frontends/xforms/FormVSpace.C	5 Feb 2004 16:19:52 -0000
@@ -42,7 +42,6 @@ using lyx::support::rtrim;
 using boost::bind;
 
 using std::remove_if;
-
 using std::vector;
 using std::string;
 
Index: src/frontends/xforms/RadioButtonGroup.C
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/frontends/xforms/RadioButtonGroup.C,v
retrieving revision 1.30
diff -u -p -b -r1.30 RadioButtonGroup.C
--- src/frontends/xforms/RadioButtonGroup.C	31 Jan 2004 15:30:23 -0000	1.30
+++ src/frontends/xforms/RadioButtonGroup.C	5 Feb 2004 16:19:52 -0000
@@ -17,13 +17,15 @@
 
 #include "debug.h"
 
-#include "support/lyxfunctional.h"
-
 #include "lyx_forms.h"
 
 #include <boost/assert.hpp>
+#include <boost/bind.hpp>
+
+using boost::bind;
 
 using std::endl;
+using std::equal_to;
 
 
 void RadioButtonGroup::init(FL_OBJECT * ob, size_type value)
@@ -41,8 +43,9 @@ void RadioButtonGroup::set(size_type val
 {
 	ButtonValueMap::const_iterator it =
 		find_if(map.begin(), map.end(),
-			lyx::equal_2nd_in_pair<ButtonValuePair>(value));
-
+			bind(equal_to<size_type>(),
+			     bind(&ButtonValueMap::value_type::second, _1),
+			     value));
 	if (it != map.end()) {
 		fl_set_button(it->first, 1);
 	} else {
Index: src/frontends/xforms/xformsImage.C
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/frontends/xforms/xformsImage.C,v
retrieving revision 1.35
diff -u -p -b -r1.35 xformsImage.C
--- src/frontends/xforms/xformsImage.C	6 Oct 2003 15:42:58 -0000	1.35
+++ src/frontends/xforms/xformsImage.C	5 Feb 2004 16:19:52 -0000
@@ -20,7 +20,6 @@
 #include "graphics/GraphicsParams.h"
 
 #include "support/lstrings.h"
-#include "support/lyxfunctional.h"  // compare_memfun
 #include "support/lyxlib.h"
 
 #include "lyx_forms.h"
@@ -33,6 +32,7 @@
 # endif
 #endif
 
+#include <boost/bind.hpp>
 #include <boost/tuple/tuple.hpp>
 
 
@@ -40,6 +40,9 @@ using lyx::support::float_equal;
 using lyx::support::prefixIs;
 using lyx::support::rtrim;
 
+using boost::bind;
+
+using std::equal_to;
 using std::find_if;
 using std::string;
 
@@ -103,7 +106,9 @@ Image::FormatList xformsImage::loadableF
 
 		Formats::const_iterator it =
 			find_if(begin, end,
-				lyx::compare_memfun(&Format::extension, ext));
+				bind(equal_to<string>(),
+				     bind(&Format::extension, _1),
+				     ext));
 		if (it != end)
 			fmts.push_back(it->name());
 	}
Index: src/graphics/PreviewLoader.C
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/graphics/PreviewLoader.C,v
retrieving revision 1.73
diff -u -p -b -r1.73 PreviewLoader.C
--- src/graphics/PreviewLoader.C	31 Jan 2004 15:30:23 -0000	1.73
+++ src/graphics/PreviewLoader.C	5 Feb 2004 16:19:53 -0000
@@ -41,7 +41,10 @@
 
 namespace support = lyx::support;
 
+using boost::bind;
+
 using std::endl;
+using std::equal_to;
 using std::find;
 using std::fill;
 using std::find_if;
@@ -77,18 +80,6 @@ Converter const * setConverter();
 void setAscentFractions(vector<double> & ascent_fractions,
 			string const & metrics_file);
 
-class FindFirst : public std::unary_function<StrPair, bool> {
-public:
-	FindFirst(string const & comp) : comp_(comp) {}
-	bool operator()(StrPair const & sp) const
-	{
-		return sp.first == comp_;
-	}
-private:
-	string const comp_;
-};
-
-
 /// Store info on a currently executing, forked process.
 struct InProgress {
 	///
@@ -354,7 +345,10 @@ public:
 		BitmapFile const & snippets = process.second.snippets;
 		BitmapFile::const_iterator beg  = snippets.begin();
 		BitmapFile::const_iterator end = snippets.end();
-		return find_if(beg, end, FindFirst(snippet_)) != end;
+		return find_if(beg, end,
+			       bind(equal_to<string>(),
+				    bind(&StrPair::first, _1),
+				    snippet_)) != end;
 	}
 
 private:
@@ -405,6 +399,9 @@ void PreviewLoader::Impl::add(string con
 
 namespace {
 
+// Is this really nice? A functor with side effects!
+// should be split into two operations: one to find what to erase,
+// and the other doing the actual erase. (Lgb)
 struct EraseSnippet {
 	EraseSnippet(string const & s) : snippet_(s) {}
 	void operator()(InProgressProcess & process)
@@ -413,9 +410,12 @@ struct EraseSnippet {
 		BitmapFile::iterator it  = snippets.begin();
 		BitmapFile::iterator end = snippets.end();
 
-		it = find_if(it, end, FindFirst(snippet_));
+		it = find_if(it, end,
+			     bind(equal_to<string>(),
+				  bind(&StrPair::first, _1),
+				  snippet_));
 		if (it != end)
-			snippets.erase(it, it+1);
+			snippets.erase(it);
 	}
 
 private:
Index: src/mathed/math_nestinset.C
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/mathed/math_nestinset.C,v
retrieving revision 1.89
diff -u -p -b -r1.89 math_nestinset.C
Index: src/support/Makefile.am
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/support/Makefile.am,v
retrieving revision 1.73
diff -u -p -b -r1.73 Makefile.am
--- src/support/Makefile.am	6 Jan 2004 19:32:05 -0000	1.73
+++ src/support/Makefile.am	5 Feb 2004 16:19:53 -0000
@@ -44,7 +44,6 @@ libsupport_la_SOURCES = \
 	lstrings.C \
 	lstrings.h \
 	lyxalgo.h \
-	lyxfunctional.h \
 	lyxlib.h \
 	lyxmanip.h \
 	lyxtime.C \
Index: src/support/forkedcontr.C
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/support/forkedcontr.C,v
retrieving revision 1.17
diff -u -p -b -r1.17 forkedcontr.C
--- src/support/forkedcontr.C	31 Jan 2004 15:30:24 -0000	1.17
+++ src/support/forkedcontr.C	5 Feb 2004 16:19:53 -0000
@@ -16,7 +16,6 @@
 
 #include "forkedcontr.h"
 #include "forkedcall.h"
-#include "lyxfunctional.h"
 #include "debug.h"
 
 #include "frontends/Timeout.h"
@@ -32,6 +31,7 @@
 using boost::bind;
 
 using std::endl;
+using std::equal_to;
 using std::find_if;
 using std::string;
 using std::vector;
@@ -187,7 +187,9 @@ string const ForkedcallsController::getC
 {
 	ListType::const_iterator it =
 		find_if(forkedCalls.begin(), forkedCalls.end(),
-			lyx::compare_memfun(&Forkedcall::pid, pid));
+			bind(equal_to<pid_t>(),
+			     bind(&Forkedcall::pid, _1),
+			     pid));
 
 	if (it == forkedCalls.end())
 		return string();
@@ -202,7 +204,9 @@ void ForkedcallsController::kill(pid_t p
 {
 	ListType::iterator it =
 		find_if(forkedCalls.begin(), forkedCalls.end(),
-			lyx::compare_memfun(&Forkedcall::pid, pid));
+			bind(equal_to<pid_t>(),
+			     bind(&Forkedcall::pid, _1),
+			     pid));
 
 	if (it == forkedCalls.end())
 		return;
Index: src/support/lstrings.C
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/support/lstrings.C,v
retrieving revision 1.85
diff -u -p -b -r1.85 lstrings.C
--- src/support/lstrings.C	1 Feb 2004 12:46:13 -0000	1.85
+++ src/support/lstrings.C	5 Feb 2004 16:19:53 -0000
@@ -19,6 +19,7 @@
 
 #include <boost/tokenizer.hpp>
 #include <boost/assert.hpp>
+#include <boost/bind.hpp>
 #include <boost/format.hpp>
 
 #include <algorithm>
@@ -26,6 +27,8 @@
 #include <cctype>
 #include <cstdlib>
 
+using boost::bind;
+
 using std::transform;
 using std::string;
 using std::vector;
@@ -236,39 +239,37 @@ char uppercase(char c)
 namespace {
 
 // since we cannot use std::tolower and std::toupper directly in the
-// calls to std::transform yet, we use these helper clases. (Lgb)
+// calls to std::transform yet, we use these helper funcs. (Lgb)
+// (I'd like to see a nice explanation why this is. (Lgb))
 
-struct local_lowercase {
-	char operator()(char c) const {
+inline
+char my_tolower(char c)
+{
 		return tolower(c);
-	}
-};
+}
 
-struct local_uppercase {
-	char operator()(char c) const {
-		return toupper(c);
-	}
-};
 
-struct local_ascii_lowercase {
-	char operator()(char c) const {
-		return ascii_tolower(c);
-	}
-};
+inline
+char my_toupper(char c)
+{
+	return toupper(c);
+}
 
 } // end of anon namespace
 
 string const lowercase(string const & a)
 {
 	string tmp(a);
-	transform(tmp.begin(), tmp.end(), tmp.begin(), local_lowercase());
+	transform(tmp.begin(), tmp.end(), tmp.begin(),
+		  my_tolower);
 	return tmp;
 }
 
 string const uppercase(string const & a)
 {
 	string tmp(a);
-	transform(tmp.begin(), tmp.end(), tmp.begin(), local_uppercase());
+	transform(tmp.begin(), tmp.end(), tmp.begin(),
+		  my_toupper);
 	return tmp;
 }
 
@@ -277,7 +278,7 @@ string const ascii_lowercase(string cons
 {
 	string tmp(a);
 	transform(tmp.begin(), tmp.end(), tmp.begin(),
-		  local_ascii_lowercase());
+		  ascii_tolower);
 	return tmp;
 }
 
Index: src/support/lyxalgo.h
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/support/lyxalgo.h,v
retrieving revision 1.15
diff -u -p -b -r1.15 lyxalgo.h
--- src/support/lyxalgo.h	31 Jan 2004 15:30:24 -0000	1.15
+++ src/support/lyxalgo.h	5 Feb 2004 16:19:53 -0000
@@ -14,7 +14,6 @@
 #ifndef LYX_ALGO_H
 #define LYX_ALGO_H
 
-#include <utility>
 #include <iterator>
 #include <algorithm>
 
@@ -46,14 +45,6 @@ bool sorted(For first, For last, Cmp cmp
 	}
 	return true;
 }
-
-
-struct firster {
-	template <class P1, class P2>
-	P1 operator()(std::pair<P1, P2> const & p) {
-		return p.first;
-	}
-};
 
 
 /**
Index: src/support/lyxfunctional.h
===================================================================
RCS file: src/support/lyxfunctional.h
diff -N src/support/lyxfunctional.h
--- src/support/lyxfunctional.h	23 Aug 2003 00:16:57 -0000	1.17
+++ /dev/null	1 Jan 1970 00:00:00 -0000
@@ -1,215 +0,0 @@
-// -*- C++ -*-
-/**
- * \file lyxfunctional.h
- * This file is part of LyX, the document processor.
- * Licence details can be found in the file COPYING.
- *
- * \author Lars Gullik Bjønnes
- *
- * Full author contact details are available in file CREDITS.
- *
- * \brief Convenient function objects for use with LyX
- *
- * This is currently a small collection of small function objects for use
- * together with std::algorithms.
- */
-
-
-#ifndef LYX_FUNCTIONAL_H
-#define LYX_FUNCTIONAL_H
-
-#include <iterator>
-
-namespace lyx {
-
-template <class Cont, class Type, class MemRet>
-class back_insert_fun_iterator {
-protected:
-	Cont * container;
-	MemRet(Type::*pmf)();
-public:
-	typedef Cont container_type;
-	typedef std::output_iterator_tag iterator_category;
-	typedef void value_type;
-	typedef void difference_type;
-	typedef void pointer;
-	typedef void reference;
-
-	back_insert_fun_iterator(Cont & x, MemRet(Type::*p)())
-		: container(&x), pmf(p) {}
-
-	back_insert_fun_iterator &
-	operator=(Type * val) {
-		container->push_back((val->*pmf)());
-		return *this;
-	}
-
-	back_insert_fun_iterator &
-	operator=(Type & val) {
-		container->push_back((val.*pmf)());
-		return *this;
-	}
-
-	back_insert_fun_iterator & operator*() {
-		return *this;
-	}
-	back_insert_fun_iterator & operator++() { // prefix ++
-		return *this;
-	}
-	back_insert_fun_iterator & operator++(int) { // postfix ++
-		return *this;
-	}
-};
-
-
-template <class Cont, class Type, class MemRet>
-class const_back_insert_fun_iterator {
-protected:
-	Cont * container;
-	MemRet(Type::*pmf)() const;
-public:
-	typedef Cont container_type;
-	typedef std::output_iterator_tag iterator_category;
-	typedef void value_type;
-	typedef void difference_type;
-	typedef void pointer;
-	typedef void reference;
-
-	const_back_insert_fun_iterator(Cont & x, MemRet(Type::*p)() const)
-		: container(&x), pmf(p) {}
-
-	~const_back_insert_fun_iterator() {}
-
-	const_back_insert_fun_iterator &
-	operator=(Type const * val) {
-		container->push_back((val->*pmf)());
-		return *this;
-	}
-
-	const_back_insert_fun_iterator &
-	operator=(Type const & val) {
-		container->push_back((val.*pmf)());
-		return *this;
-	}
-
-	const_back_insert_fun_iterator & operator*() {
-		return *this;
-	}
-	const_back_insert_fun_iterator & operator++() { // prefix ++
-		return *this;
-	}
-	const_back_insert_fun_iterator & operator++(int) { // postfix ++
-		return *this;
-	}
-};
-
-
-template <class Cont, class Type, class MemRet>
-back_insert_fun_iterator<Cont, Type, MemRet>
-back_inserter_fun(Cont & cont, MemRet(Type::*p)())
-{
-	return back_insert_fun_iterator<Cont, Type, MemRet>(cont, p);
-}
-
-
-template <class Cont, class Type, class MemRet>
-const_back_insert_fun_iterator<Cont, Type, MemRet>
-back_inserter_fun(Cont & cont, MemRet(Type::*p)() const)
-{
-	return const_back_insert_fun_iterator<Cont, Type, MemRet>(cont, p);
-}
-
-
-template <class R, class C, class A>
-class compare_memfun_t {
-public:
-	compare_memfun_t(R(C::*p)(), A const & a)
-		: pmf(p), arg(a) {}
-	bool operator()(C * c) {
-		return (c->*pmf)() == arg;
-	}
-	bool operator()(C & c) {
-		return (c.*pmf)() == arg;
-	}
-private:
-	R(C::*pmf)();
-	A const & arg;
-};
-
-
-template <class R, class C, class A>
-class const_compare_memfun_t {
-public:
-	const_compare_memfun_t(R(C::*p)() const, A const & a)
-		: pmf(p), arg(a) {}
-	bool operator()(C const * c) {
-		return (c->*pmf)() == arg;
-	}
-	bool operator()(C const & c) {
-		return (c.*pmf)() == arg;
-	}
-private:
-	R(C::*pmf)() const;
-	A const & arg;
-};
-
-
-template <class R, class C, class A>
-compare_memfun_t<R, C, A>
-compare_memfun(R(C::*p)(), A const & a)
-{
-	return compare_memfun_t<R, C, A>(p, a);
-}
-
-
-template <class R, class C, class A>
-const_compare_memfun_t<R, C, A>
-compare_memfun(R(C::*p)() const, A const & a)
-{
-	return const_compare_memfun_t<R, C, A>(p, a);
-}
-
-
-// Functors used in the template.
-
-///
-template<typename T>
-class equal_1st_in_pair {
-public:
-	///
-	typedef typename T::first_type first_type;
-	///
-	typedef T pair_type;
-	///
-	equal_1st_in_pair(first_type const & value) : value_(value) {}
-	///
-	bool operator() (pair_type const & p) const {
-		return p.first == value_;
-	}
-private:
-	///
-	first_type const & value_;
-};
-
-
-///
-template<typename T>
-class equal_2nd_in_pair {
-public:
-	///
-	typedef typename T::second_type second_type;
-	///
-	typedef T pair_type;
-	///
-	equal_2nd_in_pair(second_type const & value) : value_(value) {}
-	///
-	bool operator() (pair_type const & p) const {
-		return p.second == value_;
-	}
-private:
-	///
-	second_type const & value_;
-};
-
-}  // end of namespace lyx
-#endif
Index: src/support/translator.h
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/support/translator.h,v
retrieving revision 1.20
diff -u -p -b -r1.20 translator.h
--- src/support/translator.h	25 Sep 2003 10:49:13 -0000	1.20
+++ src/support/translator.h	5 Feb 2004 16:19:53 -0000
@@ -14,12 +14,13 @@
 
 #include <boost/assert.hpp>
 
+#include <boost/bind.hpp>
+
 #include <vector>
 #include <utility>
 #include <algorithm>
 #include <functional>
 
-#include "support/lyxfunctional.h"
 /**
  * This class template is used to translate between two elements, specifically
  * it was worked out to translate between an enum and strings when reading
@@ -62,7 +63,9 @@ public:
 		// For explanation see the next find() function.
 		typename Map::const_iterator it =
 			std::find_if(map.begin(), map.end(),
-				     lyx::equal_1st_in_pair<MapPair>(first)
+				     boost::bind(std::equal_to<T1>(),
+						 boost::bind(&MapPair::first, _1),
+						 first)
 				);
 
 		if (it != map.end()) {
@@ -89,7 +92,9 @@ public:
 		// equal_to(select2nd(pair) , second)
 		typename Map::const_iterator it =
 			std::find_if(map.begin(), map.end(),
-				     lyx::equal_2nd_in_pair<MapPair>(second)
+				     boost::bind(std::equal_to<T2>(),
+						 boost::bind(&MapPair::second, _1),
+						 second)
 				);
 
 		if (it != map.end())
Index: src/tex2lyx/text.C
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/tex2lyx/text.C,v
retrieving revision 1.33
diff -u -p -b -r1.33 text.C
--- src/tex2lyx/text.C	1 Feb 2004 12:46:14 -0000	1.33
+++ src/tex2lyx/text.C	5 Feb 2004 16:19:53 -0000
@@ -21,6 +21,8 @@
 #include "support/tostr.h"
 #include "support/filetools.h"
 
+#include <boost/iterator/indirect_iterator.hpp>
+
 #include <iostream>
 #include <map>
 #include <sstream>
@@ -30,9 +32,10 @@ using lyx::support::rtrim;
 using lyx::support::suffixIs;
 using lyx::support::contains;
 
+using boost::make_indirect_iterator;
+
 using std::cerr;
 using std::endl;
-
 using std::map;
 using std::ostream;
 using std::ostringstream;
@@ -286,11 +289,11 @@ void handle_comment(ostream & os, string
 }
 
 
-class isLayout : public std::unary_function<LyXLayout_ptr, bool> {
+class isLayout : public std::unary_function<LyXLayout, bool> {
 public:
 	isLayout(string const name) : name_(name) {}
-	bool operator()(LyXLayout_ptr const & ptr) const {
-		return ptr->latexname() == name_;
+	bool operator()(LyXLayout const & ll) const {
+		return ll.latexname() == name_;
 	}
 private:
 	string const name_;
@@ -302,9 +305,10 @@ LyXLayout_ptr findLayout(LyXTextClass co
 {
 	LyXTextClass::const_iterator beg  = textclass.begin();
 	LyXTextClass::const_iterator end = textclass.end();
-
 	LyXTextClass::const_iterator
-		it = std::find_if(beg, end, isLayout(name));
+		it = std::find_if(make_indirect_iterator(it),
+				  make_indirect_iterator(end),
+				  isLayout(name)).base();
 
 	return (it == end) ? LyXLayout_ptr() : *it;
 }
-- 
        Lgb

Reply via email to