mirror of
https://github.com/boostorg/graph.git
synced 2026-01-27 06:52:11 +00:00
added a make function
[SVN r11982]
This commit is contained in:
@@ -40,17 +40,17 @@ namespace boost {
|
||||
//
|
||||
//!category: functors
|
||||
//!component: type
|
||||
//!tparam: Decorator - a model of Decorator
|
||||
//!tparam: ReadablePropertyMap - a model of ReadablePropertyMap
|
||||
//!definition: functor.h
|
||||
template <class Decorator, class Compare>
|
||||
template <class ReadablePropertyMap, class Compare>
|
||||
class indirect_cmp {
|
||||
public:
|
||||
typedef typename boost::property_traits<Decorator>::value_type T;
|
||||
typedef typename boost::property_traits<Decorator>::key_type K;
|
||||
typedef typename boost::property_traits<ReadablePropertyMap>::value_type T;
|
||||
typedef typename boost::property_traits<ReadablePropertyMap>::key_type K;
|
||||
typedef K first_argument_type;
|
||||
typedef K second_argument_type;
|
||||
typedef T result_type;
|
||||
inline indirect_cmp(const Decorator& df, const Compare& c = Compare())
|
||||
inline indirect_cmp(const ReadablePropertyMap& df, const Compare& c = Compare())
|
||||
: d(df), cmp(c) { }
|
||||
|
||||
template <class A, class B>
|
||||
@@ -60,10 +60,15 @@ namespace boost {
|
||||
return cmp(du, dv);
|
||||
}
|
||||
protected:
|
||||
Decorator d;
|
||||
ReadablePropertyMap d;
|
||||
Compare cmp;
|
||||
};
|
||||
|
||||
template <typename Compare, typename ReadablePropertyMap>
|
||||
make_indirect_cmp(const Compare& cmp, ReadablePropertyMap map) {
|
||||
return indirect_cmp<ReadablePropertyMap, Compare>(map, cmp);
|
||||
}
|
||||
|
||||
} // namespace boost
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user