Photon 1.0.0
Loading...
Searching...
No Matches
internal.h
Go to the documentation of this file.
1#ifndef LH_INTERNAL_H
2#define LH_INTERNAL_H
3// internal.h should not be included in header files
4// internal.h should be included after all other headers in a source file
5
6namespace litehtml
7{
8
9template<class T, class TT>
10bool operator/(const T& x, const TT& xx)
11{
12 return contains(xx, x);
13}
14// a in b if b contains a
15#define in /
16
17/* Limitations of overloaded operators compared to regular function calls:
18* 1. at least one operand must be a class, so cannot just write `ch in "abc"`
19* (possible solution: ch in "abc"_s)
20* 2. operand cannot be initializer list (exception: assignment ops), so cannot just write `ch in {'a','b','c'}`
21* (possible solution: ch in ${'a','b','c'})
22*/
23
24} // namespace litehtml
25
26#endif // LH_INTERNAL_H
Definition background.h:12
bool contains(const C &coll, const T &item)
Definition html.h:94
bool operator/(const T &x, const TT &xx)
Definition internal.h:10