50 lines
1.3 KiB
Markdown
50 lines
1.3 KiB
Markdown
[bitwise.operations.and]
|
||
|
||
# 22 General utilities library [[utilities]](./#utilities)
|
||
|
||
## 22.10 Function objects [[function.objects]](function.objects#bitwise.operations.and)
|
||
|
||
### 22.10.11 Bitwise operations [[bitwise.operations]](bitwise.operations#and)
|
||
|
||
#### 22.10.11.2 Class template bit_and [bitwise.operations.and]
|
||
|
||
[ð](#lib:bit_and)
|
||
|
||
`template<class T = void> struct bit_and {
|
||
constexpr T operator()(const T& x, const T& y) const;
|
||
};
|
||
`
|
||
|
||
[ð](#lib:operator(),bit_and)
|
||
|
||
`constexpr T operator()(const T& x, const T& y) const;
|
||
`
|
||
|
||
[1](#1)
|
||
|
||
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/utilities.tex#L12950)
|
||
|
||
*Returns*: x & y[.](#1.sentence-1)
|
||
|
||
[ð](#lib:bit_and%3c%3e)
|
||
|
||
`template<> struct bit_and<void> {
|
||
template<class T, class U> constexpr auto operator()(T&& t, U&& u) const
|
||
-> decltype(std::forward<T>(t) & std::forward<U>(u));
|
||
|
||
using is_transparent = unspecified;
|
||
};
|
||
`
|
||
|
||
[ð](#lib:operator(),bit_and%3c%3e)
|
||
|
||
`template<class T, class U> constexpr auto operator()(T&& t, U&& u) const
|
||
-> decltype(std::forward<T>(t) & std::forward<U>(u));
|
||
`
|
||
|
||
[2](#2)
|
||
|
||
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/utilities.tex#L12972)
|
||
|
||
*Returns*: std::forward<T>(t) & std::forward<U>(u)[.](#2.sentence-1)
|