Home     |     .Net Programming    |     cSharp Home    |     Sql Server Home    |     Javascript / Client Side Development     |     Ajax Programming

Ruby on Rails Development     |     Perl Programming     |     C Programming Language     |     C++ Programming     |     IT Jobs

Python Programming Language     |     Laptop Suggestions?    |     TCL Scripting     |     Fortran Programming     |     Scheme Programming Language


 
 
Cervo Technologies
The Right Source to Outsource

MS Dynamics CRM 3.0

C# Programming

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

On May 30, 12:01 pm, "Bengan" <b@yahoo.com> wrote:

> 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

-----------------------------------------------Reply-----------------------------------------------

E.g. http://www.c-sharpcorner.com/UploadFile/prasadh/OperatorOverloading11...

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

B> Hi!
B>
B> Where can you see if a class has overloaded operator(like +,-) in
B> Microsofts NET class library on the net? They list members,
B> properties, fields and other stuff for a class but no
B> operatoroverloading.
B>
B> It would be nice to know if a class uses overloaded opetors so you
B> know if its the default behavior or not when using these operators.
B>
B> Regards
B> Bengan

-----------------------------------------------Reply-----------------------------------------------

"Jon Skeet [C# MVP]" <s@pobox.com> schrieb im Newsbeitrag
news:1180523923.706090.97220@k79g2000hse.googlegroups.com...
> On May 30, 12:01 pm, "Bengan" <b@yahoo.com> wrote:
>> 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

-----------------------------------------------Reply-----------------------------------------------

On May 30, 1:27 pm, "Christof Nordiek" <c@nospam.de> wrote:

> > 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

Add to del.icio.us | Digg this | Stumble it | Powered by Megasolutions Inc