prime/include/rstl/pair.hpp
Henrique Gemignani Passos Lima d86009a79d Add rstl::binary_find
Including CAnimData::GetBoundingBox


Former-commit-id: e4a864880ba8b0b7c023bb7562b86b7d07dbc99f
2022-12-05 23:35:31 +02:00

35 lines
669 B
C++

#ifndef _RSTL_PAIR
#define _RSTL_PAIR
#include "types.h"
namespace rstl {
template < typename L, typename R >
class pair {
public:
pair() {}
pair(const L& first, const R& second) : first(first), second(second) {}
bool operator==(const pair& other) const { return first == other.first && second == other.second; }
L first;
R second;
};
template < typename P >
struct select1st {
const P& operator()(const P& it) const { return it; }
};
template < typename K, typename V >
struct select1st< pair< K, V > > {
typedef K value_type;
const K& operator()(const pair< K, V >& it) const { return it.first; }
};
} // namespace rstl
#endif // _RSTL_PAIR