Say I want to define all the operator==, operator!=, operator<=,
operator>, etc for a class.
I could've sworn there was a library (maybe in Boost) that helped me do
this (so I don't have to define all of them by hand).
Was I imagining it?
Thanks,
Joe 4 1569
Joe Van Dyk wrote:
Say I want to define all the operator==, operator!=, operator<=,
operator>, etc for a class.
So, define them. What's stopping you?
I could've sworn there was a library (maybe in Boost) that helped me
do this (so I don't have to define all of them by hand).
Was I imagining it?
Quite possible. What kind of "help" do you expect?
V
--
Please remove capital 'A's when replying by e-mail
I do not respond to top-posted replies, please don't ask
Joe Van Dyk wrote:
Say I want to define all the operator==, operator!=, operator<=,
operator>, etc for a class.
I could've sworn there was a library (maybe in Boost)
Would you be surprised if I told you it was Boost::operators? http://www.boost.org/libs/utility/operators.htm
On Thu, 10 Aug 2006 06:19:13 -0700, Michiel.Salters wrote:
>
Joe Van Dyk wrote:
>Say I want to define all the operator==, operator!=, operator<=, operator>, etc for a class.
I could've sworn there was a library (maybe in Boost)
Would you be surprised if I told you it was Boost::operators?
http://www.boost.org/libs/utility/operators.htm
Ah, thanks. That looks like what I was looking for.
Joe
On Wed, 09 Aug 2006 23:24:10 -0400, Victor Bazarov wrote:
Joe Van Dyk wrote:
>Say I want to define all the operator==, operator!=, operator<=, operator>, etc for a class.
So, define them. What's stopping you?
Because in most cases, defining all of them duplicates knowledge. Which I
try to avoid. And it's tedious and boring.
>I could've sworn there was a library (maybe in Boost) that helped me do this (so I don't have to define all of them by hand). Was I imagining it?
Quite possible. What kind of "help" do you expect?
A way for me to specify the results of a couple of the operators, and have
the others generated through some means. This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
by: Michael Klatt |
last post by:
I've just encountered a strange situation (at least to me) regarding
friend operators and member operators:
#include <map>
class Key
{
friend bool operator<(const Key& lhs, const Key& rhs)...
|
by: jstanforth |
last post by:
This is probably a very obvious question, but I'm not clear on what
operators need to be implemented for std::map.find() to work. For
example, I have a class MyString that wraps std::string, and...
|
by: Steven D'Aprano |
last post by:
Playing around with comparisons of functions (don't ask), I discovered an
interesting bit of unintuitive behaviour:
>>> (lambda y: y) < (lambda y: y)
False
Do the comparison again and things...
|
by: PengYu.UT |
last post by:
I'm wonder whether
1. stl directly defined the 6 comparison operators(== != < > <= >=)
directly for iterator and const_iterator
2. or it only define == and < and using std::rel_ops to get the...
|
by: Thats Me |
last post by:
TMALSS: Task With maintenance of Access Database I did not develop,
don't ask about non-commented code problems or where data dictionary
is (LOL).
Have table with Inventory data for all...
| |
by: Serve La |
last post by:
Now that implementations are becoming available, I've started to
learn more about C99.
Now I was reading about the isgreater/isgreaterequal/isless/...
macro's and I'm wondering about why they are...
|
by: spam.noam |
last post by:
Hello,
Guido has decided, in python-dev, that in Py3K the id-based order
comparisons will be dropped. This means that, for example, "{} < "
will raise a TypeError instead of the current...
|
by: Dinsdale |
last post by:
I would like to compare a string value to a pre-determined list of
other strings. Is there a simple way to do this in one statements like
this:
if(strMystring.ToUpper() == ("STRING1"| "STRING2"|...
|
by: Mark Rae |
last post by:
Hi,
This isn't *specifically* an ASP.NET question, so I've also posted it in the
ADO.NET group - however, it's not too far off-topic...
Imagine a SQL Server 2005 database with a table with an...
|
by: puzzlecracker |
last post by:
Unlike C++, in Csharp you're only allowed to compare a generic type T
with null, if the method it's passed in not implementing
IComparable<Tor , IEquatable<T(still don't know why we need these...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
| |
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers,...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new...
|
by: conductexam |
last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
| |
by: 6302768590 |
last post by:
Hai team
i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
|
by: bsmnconsultancy |
last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...
| |