diff options
author | Pavel Labath <pavelo@centrum.sk> | 2011-07-25 13:39:41 (GMT) |
---|---|---|
committer | Pavel Labath <pavelo@centrum.sk> | 2011-09-14 17:39:11 (GMT) |
commit | 05b5974e62fc2ae23262a4930206be8342b148fb (patch) | |
tree | f71b04a308e6dd9ba1b33544cb6394061eec4908 /src | |
parent | 536a16e6e2d9080aec9df9d488d41296888e5cd9 (diff) | |
download | fluxbox_paul-05b5974e62fc2ae23262a4930206be8342b148fb.zip fluxbox_paul-05b5974e62fc2ae23262a4930206be8342b148fb.tar.bz2 |
Add comparison operators to FbTk::RefCount
without them, gcc would compare them by converting them to bool first, which is not exactly what
one would expect. Frankly, I'm surprised it even worked without this.
Diffstat (limited to 'src')
-rw-r--r-- | src/FbTk/RefCount.hh | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/src/FbTk/RefCount.hh b/src/FbTk/RefCount.hh index cc8c917..5325b78 100644 --- a/src/FbTk/RefCount.hh +++ b/src/FbTk/RefCount.hh | |||
@@ -152,6 +152,36 @@ inline RefCount<Pointer> makeRef(const Arg1 &arg1, const Arg2 &arg2, const Arg3 | |||
152 | return RefCount<Pointer>(new Pointer(arg1, arg2, arg3)); | 152 | return RefCount<Pointer>(new Pointer(arg1, arg2, arg3)); |
153 | } | 153 | } |
154 | 154 | ||
155 | template <typename Pointer, typename Pointer2> | ||
156 | inline bool operator == (const RefCount<Pointer> &a, const RefCount<Pointer2> &b) { | ||
157 | return a.get() == b.get(); | ||
158 | } | ||
159 | |||
160 | template <typename Pointer, typename Pointer2> | ||
161 | inline bool operator != (const RefCount<Pointer> &a, const RefCount<Pointer2> &b) { | ||
162 | return a.get() != b.get(); | ||
163 | } | ||
164 | |||
165 | template <typename Pointer, typename Pointer2> | ||
166 | inline bool operator < (const RefCount<Pointer> &a, const RefCount<Pointer2> &b) { | ||
167 | return a.get() < b.get(); | ||
168 | } | ||
169 | |||
170 | template <typename Pointer, typename Pointer2> | ||
171 | inline bool operator > (const RefCount<Pointer> &a, const RefCount<Pointer2> &b) { | ||
172 | return a.get() > b.get(); | ||
173 | } | ||
174 | |||
175 | template <typename Pointer, typename Pointer2> | ||
176 | inline bool operator <= (const RefCount<Pointer> &a, const RefCount<Pointer2> &b) { | ||
177 | return a.get() <= b.get(); | ||
178 | } | ||
179 | |||
180 | template <typename Pointer, typename Pointer2> | ||
181 | inline bool operator >= (const RefCount<Pointer> &a, const RefCount<Pointer2> &b) { | ||
182 | return a.get() >= b.get(); | ||
183 | } | ||
184 | |||
155 | } // end namespace FbTk | 185 | } // end namespace FbTk |
156 | 186 | ||
157 | #endif // FBTK_REFCOUNT_HH | 187 | #endif // FBTK_REFCOUNT_HH |