
Boost : 
From: Matthias Troyer (troyer_at_[hidden])
Date: 20030427 13:07:44
Dear Boosters,
Since there was no reply to my message of three weeks ago I assume
there is no interest in the Boost community and we will keep this in
our own libraries.
Matthias
Begin forwarded message:
> From: Matthias Troyer <troyer_at_[hidden]>
> Date: Sat Apr 5, 2003 12:40:09 PM Europe/Zurich
> To: boost_at_[hidden]
> Subject: bit_and, bit_or, ... function object
>
> Dear Boosters,
>
> Mario Rueti, a student in my group, needed and wrote the following
> function objects which seem to be missing in the standard library
> (only arithmetic and logical operations seem to be defined as function
> objects). Since these might be of more general interest we wonder if
> they might fit into boost, e.g. into functional.hpp ?
>
> Matthias
>
>
> namespace boost {
> // definition of function objects not defined by STL
> template <class T>
> struct bit_and : public binary_function<T,T,T>
> {
> T operator()(const T& x, const T& y) const { return x & y; }
> };
>
> template <class T>
> struct bit_or : public binary_function<T,T,T>
> {
> T operator()(const T& x, const T& y) const { return x  y; }
> };
>
> template <class T>
> struct bit_xor : public binary_function<T,T,T>
> {
> T operator()(const T& x, const T& y) const { return x ^ y; }
> };
>
> template <class T>
> struct bit_not : public unary_function<T,T>
> {
> T operator()(const T& x) const { return ~x; }
> };
> }
>
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk