2
0
mirror of https://github.com/boostorg/icl.git synced 2026-01-19 04:12:13 +00:00

Merge branch 'feature/handle-deprecated-c++98-adapters' of https://github.com/DanielaE/boost.icl into feature/handle-deprecated-c++98-adapters

This commit is contained in:
Peter Dimov
2017-11-21 20:50:11 +02:00
3 changed files with 23 additions and 9 deletions

View File

@@ -8,7 +8,6 @@ Copyright (c) 2007-2009: Joachim Faulhaber
#ifndef BOOST_ICL_FUNCTORS_HPP_JOFA_080315
#define BOOST_ICL_FUNCTORS_HPP_JOFA_080315
#include <functional>
#include <boost/type_traits.hpp>
#include <boost/mpl/if.hpp>
#include <boost/icl/type_traits/identity_element.hpp>
@@ -20,15 +19,19 @@ namespace boost{namespace icl
{
// ------------------------------------------------------------------------
template <typename Type> struct identity_based_inplace_combine
: public std::binary_function<Type&, const Type&, void>
{
typedef Type& first_argument_type;
typedef const Type& second_argument_type;
typedef void result_type;
inline static Type identity_element() { return boost::icl::identity_element<Type>::value(); }
};
// ------------------------------------------------------------------------
template <typename Type> struct unit_element_based_inplace_combine
: public std::binary_function<Type&, const Type&, void>
{
typedef Type& first_argument_type;
typedef const Type& second_argument_type;
typedef void result_type;
inline static Type identity_element() { return boost::icl::unit_element<Type>::value(); }
};

View File

@@ -8,8 +8,6 @@ Copyright (c) 2010-2010: Joachim Faulhaber
#ifndef BOOST_ICL_TYPE_TRAITS_PREDICATE_HPP_JOFA_101102
#define BOOST_ICL_TYPE_TRAITS_PREDICATE_HPP_JOFA_101102
#include <functional>
namespace boost{namespace icl
{
// naming convention
@@ -20,7 +18,12 @@ namespace boost{namespace icl
// Unary predicates
template <class Type>
class property : public std::unary_function<Type,bool>{};
class property
{
public:
typedef Type argument_type;
typedef bool result_type;
};
template <class Type>
class member_property : public property<Type>
@@ -35,7 +38,13 @@ namespace boost{namespace icl
// Binary predicates: relations
template <class LeftT, class RightT>
class relation : public std::binary_function<LeftT,RightT,bool>{};
class relation
{
public:
typedef LeftT first_argument_type;
typedef RightT second_argument_type;
typedef bool result_type;
};
}} // namespace icl boost

View File

@@ -8,7 +8,6 @@ Copyright (c) 2008-2010: Joachim Faulhaber
#ifndef BOOST_LIBS_ICL_TEST_ICL_LAWS_HPP_JOFA_090119
#define BOOST_LIBS_ICL_TEST_ICL_LAWS_HPP_JOFA_090119
#include <functional>
#include <boost/icl/type_traits/identity_element.hpp>
#include <boost/icl/associative_interval_container.hpp>
@@ -16,8 +15,11 @@ namespace boost{namespace icl
{
template<class Type>
struct equality : std::binary_function<Type,Type,bool>
struct equality
{
typedef Type first_argument_type;
typedef Type second_argument_type;
typedef bool result_type;
typedef bool (type)(const Type&, const Type&);
};