@@ -51,9 +51,9 @@ using namespace __gnu_pbds;
// A simple hash functor.
// hash could serve instead of this functor, but it is not yet
// standard everywhere.
-struct string_hash : public unary_function<string, size_t>
+struct string_hash
{
- inline size_t
+ size_t
operator()(const string& r_s) const
{
size_t ret = 0;
@@ -48,7 +48,7 @@ using namespace __gnu_pbds;
// The following functor takes a map's value-type object and returns
// whether its key is between two numbers.
-struct between : public unary_function<pair<const int, char>, bool>
+struct between
{
// Constructor taking two numbers determining a range.
between(int b, int e) : m_b(b), m_e(e)
@@ -56,7 +56,7 @@ struct between : public unary_function<pair<const int, char>, bool>
// Operator determining whether a value-type object's key is within
// the range.
- inline bool
+ bool
operator()(const pair<const int, char>& r_val)
{ return r_val.first >= m_b&& r_val.first < m_e; }
@@ -62,9 +62,9 @@ using namespace __gnu_pbds;
// A simple hash functor.
// hash could serve instead of this functor, but it is not yet
// standard everywhere.
-struct int_hash : public unary_function<int, size_t>
+struct int_hash
{
- inline size_t
+ size_t
operator()(const int& r_i) const
{ return r_i; }
};
@@ -49,9 +49,9 @@ using namespace __gnu_pbds;
// A simple hash functor.
// hash could serve instead of this functor, but it is not yet
// standard everywhere.
-struct int_hash : public unary_function<int, size_t>
+struct int_hash
{
- inline size_t
+ size_t
operator()(const int& r_i) const
{ return r_i; }
};
@@ -51,9 +51,9 @@ using namespace __gnu_pbds;
// A simple hash functor.
// hash could serve instead of this functor, but it is not yet
// standard everywhere.
-struct int_hash : public unary_function<int, size_t>
+struct int_hash
{
- inline size_t
+ size_t
operator()(int i) const
{ return i; }
};
@@ -49,9 +49,9 @@ using namespace __gnu_pbds;
// A simple hash functor.
// hash could serve instead of this functor, but it is not yet
// standard everywhere.
-struct int_hash : public unary_function<int, size_t>
+struct int_hash
{
- inline size_t
+ size_t
operator()(int i) const
{ return i; }
};
@@ -50,9 +50,9 @@ using namespace __gnu_pbds;
// A simple hash functor.
// hash could serve instead of this functor, but it is not yet
// standard everywhere.
-struct int_hash : public unary_function<int, size_t>
+struct int_hash
{
- inline size_t
+ size_t
operator()(const int& r_i) const
{ return r_i; }
};
@@ -51,9 +51,9 @@ using namespace __gnu_pbds;
// A simple hash functor. hash could serve instead of this functor,
// but it is not yet standard everywhere.
-struct simple_int_hash : public unary_function<int, size_t>
+struct simple_int_hash
{
- inline size_t
+ size_t
operator()(int i) const
{ return i; }
};
@@ -61,9 +61,9 @@ using namespace __gnu_pbds;
typedef std::pair<size_t, size_t> pq_value;
// Comparison functor used to compare priority-queue value types.
-struct pq_value_cmp : public binary_function<pq_value, pq_value, bool>
+struct pq_value_cmp
{
- inline bool
+ bool
operator()(const pq_value& r_lhs, const pq_value& r_rhs) const
{
// Note that a value is considered smaller than a different value
@@ -60,7 +60,6 @@ using namespace __gnu_pbds;
* for larger sizes it uses a more complicated hash function.
*/
class simple_string_ranged_hash_fn
- : public unary_function<string, size_t>
{
public:
typedef size_t size_type;
@@ -53,9 +53,9 @@ using namespace std;
using namespace __gnu_pbds;
// A string hash functor.
-struct string_hash : public unary_function<string, size_t>
+struct string_hash
{
- inline size_t
+ size_t
operator()(string str) const
{
string::const_iterator b = str.begin();