#ifndef cathlibcpp_hoistup_H
#define cathlibcpp_hoistup_H

// File:       hoistup.h
// Author:     (c) Miles Sabin, 1997
// Purpose:    hoisted unary predicate


#ifndef cathlibcpp_bool_H
#include "bool.h"
#endif

#ifndef cathlibcpp_config_H
#include "config.h"
#endif

#ifndef cathlibcpp_hoistupp_H
#include "hoistupp.h"
#endif


template<class UnaryPredicate, class T>
class HoistUnaryPredicate : public HoistUnaryPredicateProtocol
{
  public:

    // constructors
    HoistUnaryPredicate(UnaryPredicate const& pred)
      : pred_(pred)
      {}

    ~HoistUnaryPredicate();

    // accessors
    bool operator()(void const* x) const;

  private:

    UnaryPredicate const& pred_;
};


template<class UnaryPredicate, class T>
inline HoistUnaryPredicate<UnaryPredicate, T> make_hoist_unary_predicate(UnaryPredicate const& pred, T*)
{
  return HoistUnaryPredicate<UnaryPredicate, T>(pred);
}

#endif
