summaryrefslogtreecommitdiffstats
path: root/ext/boost/mpl/max_element.hpp
diff options
context:
space:
mode:
authorJelte Jansen <jelte@isc.org>2009-10-30 01:32:12 +0100
committerJelte Jansen <jelte@isc.org>2009-10-30 01:32:12 +0100
commit537ddbf8cde7038e0701b8eaab0d860813feff07 (patch)
tree25b147803bcccfff2ab0c34925d005266136230b /ext/boost/mpl/max_element.hpp
parentbetter zoneset type (diff)
downloadkea-537ddbf8cde7038e0701b8eaab0d860813feff07.tar.xz
kea-537ddbf8cde7038e0701b8eaab0d860813feff07.zip
include boost headers (all base ones, and asio; don't know if asio needs more than just the headers though)
git-svn-id: svn://bind10.isc.org/svn/bind10/branches/f2f200910@210 e5f2f494-b856-4b98-b285-d166d9295462
Diffstat (limited to 'ext/boost/mpl/max_element.hpp')
-rw-r--r--ext/boost/mpl/max_element.hpp72
1 files changed, 72 insertions, 0 deletions
diff --git a/ext/boost/mpl/max_element.hpp b/ext/boost/mpl/max_element.hpp
new file mode 100644
index 0000000000..6d16dfcb81
--- /dev/null
+++ b/ext/boost/mpl/max_element.hpp
@@ -0,0 +1,72 @@
+
+#ifndef BOOST_MPL_MAX_ELEMENT_HPP_INCLUDED
+#define BOOST_MPL_MAX_ELEMENT_HPP_INCLUDED
+
+// Copyright Aleksey Gurtovoy 2000-2004
+//
+// Distributed under the Boost Software License, Version 1.0.
+// (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+//
+// See http://www.boost.org/libs/mpl for documentation.
+
+// $Id: max_element.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
+// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $
+// $Revision: 49267 $
+
+#include <boost/mpl/less.hpp>
+#include <boost/mpl/iter_fold.hpp>
+#include <boost/mpl/begin_end.hpp>
+#include <boost/mpl/if.hpp>
+#include <boost/mpl/deref.hpp>
+#include <boost/mpl/apply.hpp>
+#include <boost/mpl/aux_/common_name_wknd.hpp>
+#include <boost/mpl/aux_/na_spec.hpp>
+
+namespace boost { namespace mpl {
+
+BOOST_MPL_AUX_COMMON_NAME_WKND(max_element)
+
+namespace aux {
+
+template< typename Predicate >
+struct select_max
+{
+ template< typename OldIterator, typename Iterator >
+ struct apply
+ {
+ typedef typename apply2<
+ Predicate
+ , typename deref<OldIterator>::type
+ , typename deref<Iterator>::type
+ >::type condition_;
+
+ typedef typename if_<
+ condition_
+ , Iterator
+ , OldIterator
+ >::type type;
+ };
+};
+
+} // namespace aux
+
+
+template<
+ typename BOOST_MPL_AUX_NA_PARAM(Sequence)
+ , typename Predicate = less<_,_>
+ >
+struct max_element
+ : iter_fold<
+ Sequence
+ , typename begin<Sequence>::type
+ , protect< aux::select_max<Predicate> >
+ >
+{
+};
+
+BOOST_MPL_AUX_NA_SPEC(1, max_element)
+
+}}
+
+#endif // BOOST_MPL_MAX_ELEMENT_HPP_INCLUDED