473,396 Members | 2,030 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

How do know if a class use operator overload?


Hi!

Where can you see if a class has overloaded operator(like +,-) in Microsofts
NET class library on the net? They list members, properties, fields and
other stuff for a class but no operatoroverloading.

It would be nice to know if a class uses overloaded opetors so you know if
its the default behavior or not when using these operators.

Regards
Bengan
May 30 '07 #1
4 1703
On May 30, 12:01 pm, "Bengan" <b...@yahoo.comwrote:
Where can you see if a class has overloaded operator(like +,-) in Microsofts
NET class library on the net? They list members, properties, fields and
other stuff for a class but no operatoroverloading.

It would be nice to know if a class uses overloaded opetors so you know if
its the default behavior or not when using these operators.
Operators *are* documented, as opGreaterThan, opInequality etc
methods. See DateTime for an example.

Jon

May 30 '07 #2
E.g. http://www.c-sharpcorner.com/UploadF...erloading.aspx

WBR, Alex Meleta
Blog:: devkids.blogspot.com

BHi!
B>
BWhere can you see if a class has overloaded operator(like +,-) in
BMicrosofts NET class library on the net? They list members,
Bproperties, fields and other stuff for a class but no
Boperatoroverloading.
B>
BIt would be nice to know if a class uses overloaded opetors so you
Bknow if its the default behavior or not when using these operators.
B>
BRegards
BBengan
May 30 '07 #3
"Jon Skeet [C# MVP]" <sk***@pobox.comschrieb im Newsbeitrag
news:11*********************@k79g2000hse.googlegro ups.com...
On May 30, 12:01 pm, "Bengan" <b...@yahoo.comwrote:
>Where can you see if a class has overloaded operator(like +,-) in
Microsofts
NET class library on the net? They list members, properties, fields and
other stuff for a class but no operatoroverloading.

It would be nice to know if a class uses overloaded opetors so you know
if
its the default behavior or not when using these operators.

Operators *are* documented, as opGreaterThan, opInequality etc
methods. See DateTime for an example.
But they don't list operators predefined by C# (like int + int). For this
you have to look in the C# reference or specification.

Christof
May 30 '07 #4
On May 30, 1:27 pm, "Christof Nordiek" <c...@nospam.dewrote:
Operators *are* documented, as opGreaterThan, opInequality etc
methods. See DateTime for an example.

But they don't list operators predefined by C# (like int + int). For this
you have to look in the C# reference or specification.
Indeed. For *most* of the operators, this is probably expected. The
one which is most likely to catch people out (IMO) is string
concatenation, which is a C# operator but not a .NET operator. (The C#
compiler can call String.Concat to concatenate multiple strings in one
go, for instance, which couldn't be done by a normal + operator.)

Jon

May 30 '07 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

10
by: Chiller | last post by:
Ok, this is a continuation of a problem I posted on an earlier thread. I've started another thread because my problem has progressed from the initial constructor problem into a general method...
1
by: Douglas Peterson | last post by:
class Allocator { public: virtual void * Alloc(size_t) = 0; virtual void * Free(void*) = 0; }; class Object { public:
7
by: Sean | last post by:
Can someone help me see why the following "operator=" overloading doesn't work under g++? and the error message is copied here. I see no reason the compiler complain this. Thanks, $ g++...
17
by: Chris | last post by:
To me, this seems rather redundant. The compiler requires that if you overload the == operator, you must also overload the != operator. All I do for the != operator is something like this: ...
10
by: mast2as | last post by:
Is it possible to limit a template class to certain types only. I found a few things on the net but nothing seems to apply at compile time. template <typename T> class AClass { public:...
4
by: alacrite | last post by:
I have a class that I want to turn its contents into csv file. I want to be able to set the value of the delimiter, the name of the file it gets saved to, the path of that file, and maybe a few...
3
by: Hamilton Woods | last post by:
Diehards, I developed a template matrix class back around 1992 using Borland C++ 4.5 (ancestor of C++ Builder) and haven't touched it until a few days ago. I pulled it from the freezer and...
10
by: =?iso-8859-2?B?SmFuIFJpbmdvuQ==?= | last post by:
Hello everybody, this is my first post to a newsgroup at all. I would like to get some feedback on one proposal I am thinking about: --- begin of proposal --- Proposal to add...
8
by: Malciah | last post by:
I posted this on another site, but so far I've had no answers. So, I decided to try it here. -------------------------------------------------------- I've been learning C++ for about 6 weeks now,...
14
by: Jess | last post by:
Hi, I read about operator overloading and have a question regarding "operator->()". If I have two classes like this: struct A{ void f(); }; struct B{
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
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...
0
Oralloy
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,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
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...
0
agi2029
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,...
0
isladogs
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 using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.