18 #include <type_traits>
29 using is_id_type = std::integral_constant<bool,
30 std::is_same<T, edge_id>::value || std::is_same<T, node_id>::value>;
33 template<
typename T,
typename Result>
34 using enable_if_id =
typename std::enable_if<dyng::is_id_type<T>::value, Result>::type;
39 enable_if_id<T, bool> operator==(
const T& a,
const T& b) {
40 return a.value == b.value;
44 enable_if_id<T, bool> operator!=(
const T& a,
const T& b) {
49 enable_if_id<T, bool> operator<(
const T& a,
const T& b) {
50 return a.value < b.value;
54 enable_if_id<T, bool> operator>(
const T& a,
const T& b) {
55 return a.value > b.value;
59 enable_if_id<T, bool> operator<=(
const T& a,
const T& b) {
64 enable_if_id<T, bool> operator>=(
const T& a,
const T& b) {
69 enable_if_id<T, std::ostream&> operator<<(std::ostream& out,
const T&
id) {
70 return out <<
id.value;
98 struct hash<dyng::node_id>{
100 return std::hash<unsigned>()(
id.value);
105 struct hash<dyng::edge_id>{
107 return std::hash<unsigned>()(
id.value);