esp8266ndn
NDN Arduino library for ESP8266 and more
Loading...
Searching...
No Matches
operators.hpp
Go to the documentation of this file.
1#ifndef NDNPH_CORE_OPERATORS_HPP
2#define NDNPH_CORE_OPERATORS_HPP
3
4#include "common.hpp"
5
7#define NDNPH_DECLARE_NE(T, specifier) \
8 specifier bool operator!=(const T& lhs, const T& rhs) { return !(lhs == rhs); }
9
11#define NDNPH_DECLARE_GT_LE_GE(T, specifier) \
12 specifier bool operator>(const T& lhs, const T& rhs) { return rhs < lhs; } \
13 specifier bool operator<=(const T& lhs, const T& rhs) { return !(lhs > rhs); } \
14 specifier bool operator>=(const T& lhs, const T& rhs) { return !(lhs < rhs); }
15
16namespace ndnph {
17
23template<typename I>
24inline typename std::enable_if<std::is_integral<I>::value, I>::type
25divCeil(const I& a, const I& b) {
26 return (a + b - 1) / b;
27}
28
29} // namespace ndnph
30
31#endif // NDNPH_CORE_OPERATORS_HPP
Definition fs.hpp:33
std::enable_if< std::is_integral< I >::value, I >::type divCeil(const I &a, const I &b)
Compute ceil( a / b ).
Definition operators.hpp:25