VB .Net does support operator overloading, doesn't it? It seems like this
should overload binary addition, but VB doesn't recognize "Operator"
Public Shared Operator +(ByVal c1 as cnum, ByVal c2 as cnum) as cnum
' End of statement expected
End Operator
--
Jon Cosby
Please do not reply to this email address. 13 1759
Jon,
No VB.net in this versions does not support operator overloading, it will in
the next.
You can read for it in this newsgroup in a messagesthread from yesterday
Cor VB .Net does support operator overloading, doesn't it? It seems like this should overload binary addition, but VB doesn't recognize "Operator"
Public Shared Operator +(ByVal c1 as cnum, ByVal c2 as cnum) as cnum ' End of statement expected
End Operator
* "Jon Cosby" <qw****@nospam.net> scripsit: VB .Net does support operator overloading, doesn't it? It seems like this should overload binary addition, but VB doesn't recognize "Operator"
Public Shared Operator +(ByVal c1 as cnum, ByVal c2 as cnum) as cnum ' End of statement expected
End Operator
Wait for VS.NET 2004, VB.NET currently doesn't support operator
overloading.
--
Herfried K. Wagner [MVP]
<http://www.mvps.org/dotnet>
There's a section titled "Operator Overloading Usage Guidelines in Visual
Basic" in the documentation. What's that referring to?
Jon
"Cor" wrote: Jon,
No VB.net in this versions does not support operator overloading, it will
in the next.
You can read for it in this newsgroup in a messagesthread from yesterday
Cor VB .Net does support operator overloading, doesn't it? It seems like
this should overload binary addition, but VB doesn't recognize "Operator"
Public Shared Operator +(ByVal c1 as cnum, ByVal c2 as cnum) as cnum ' End of statement expected
End Operator
* "Jon Cosby" <qw****@nospam.net> scripsit: There's a section titled "Operator Overloading Usage Guidelines in Visual Basic" in the documentation. What's that referring to?
Can you post the link?
--
Herfried K. Wagner [MVP]
<http://www.mvps.org/dotnet>
ms-help://MS.VSCC/MS.MSDNVS/cpgenref/html/cpconoperatoroverloadingusageguide
lines.htm
"Herfried K. Wagner [MVP]" <hi***************@gmx.at> wrote in message
news:OE**************@tk2msftngp13.phx.gbl... * "Jon Cosby" <qw****@nospam.net> scripsit: There's a section titled "Operator Overloading Usage Guidelines in
Visual Basic" in the documentation. What's that referring to?
Can you post the link?
-- Herfried K. Wagner [MVP] <http://www.mvps.org/dotnet>
* "Jon Cosby" <qw****@nospam.net> scripsit: ms-help://MS.VSCC/MS.MSDNVS/cpgenref/html/cpconoperatoroverloadingusageguide lines.htm
The document is talking about the .NET Framework and provides samples in
C++/C#:
<http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpgenref/html/cpconoperatoroverloadingusageguidelines.asp>
--
Herfried K. Wagner [MVP]
<http://www.mvps.org/dotnet>
You can actually implement operator overloading routines, but cannot use
them in VB.NET, well, you can, but not in the traditional sense. You need to
call the routines that implement operator overloading, instead of using the
actual operators.
The routines are defined as op_***
where *** is the type of operator to overload, e.g. op_Implicit etc
--
HTH,
-- Tom Spink, Über Geek
Woe be the day VBC.EXE says, "OrElse what?"
Please respond to the newsgroup,
so all can benefit
"Herfried K. Wagner [MVP]" <hi***************@gmx.at> wrote in message
news:eS**************@tk2msftngp13.phx.gbl... * "Jon Cosby" <qw****@nospam.net> scripsit:
ms-help://MS.VSCC/MS.MSDNVS/cpgenref/html/cpconoperatoroverloadingusageguide lines.htm The document is talking about the .NET Framework and provides samples in C++/C#:
<http://msdn.microsoft.com/library/de...-us/cpgenref/h
tml/cpconoperatoroverloadingusageguidelines.asp> -- Herfried K. Wagner [MVP] <http://www.mvps.org/dotnet>
Tom,
* "Tom Spink" <thomasdotspinkat@ntlworlddotcom> scripsit: You can actually implement operator overloading routines, but cannot use them in VB.NET, well, you can, but not in the traditional sense. You need to call the routines that implement operator overloading, instead of using the actual operators.
The routines are defined as op_***
where *** is the type of operator to overload, e.g. op_Implicit etc
That's what the article I referenced is saying.
;-)
--
Herfried K. Wagner [MVP]
<http://www.mvps.org/dotnet>
Jon,
VB.NET 2002 & 2003 only supports indirectly consuming overloaded operators
by the method that Tom Spink & Herfried indicated.
As Herfried stated, you need to wait for Whidbey for VB.NET to support
creating & consuming overloaded operators.
For a preview of what it will look like see: http://blogs.msdn.com/cambecc/archiv.../20/51265.aspx
Hope this helps
Jay
"Jon Cosby" <qw****@nospam.net> wrote in message
news:Bv*****************@newsread1.news.pas.earthl ink.net... VB .Net does support operator overloading, doesn't it? It seems like this should overload binary addition, but VB doesn't recognize "Operator"
Public Shared Operator +(ByVal c1 as cnum, ByVal c2 as cnum) as cnum ' End of statement expected
End Operator --
Jon Cosby
Please do not reply to this email address.
Tom, You can actually implement operator overloading routines,
No you can't. You can consume most operator functions defined in other
languages, but you can't define your own. Just giving it the right
name (the op_ prefix) isn't enough.
Mattias
--
Mattias Sjögren [MVP] mattias @ mvps.org http://www.msjogren.net/dotnet/ | http://www.dotnetinterop.com
Please reply only to the newsgroup.
Okay! Fair enough... but just out of interest... what is 'enough'?
--
HTH,
-- Tom Spink, Über Geek
Woe be the day VBC.EXE says, "OrElse what?"
Please respond to the newsgroup,
so all can benefit
"Mattias Sjögren" <ma********************@mvps.org> wrote in message
news:OH**************@TK2MSFTNGP10.phx.gbl... Tom,
You can actually implement operator overloading routines,
No you can't. You can consume most operator functions defined in other languages, but you can't define your own. Just giving it the right name (the op_ prefix) isn't enough. Mattias
-- Mattias Sjögren [MVP] mattias @ mvps.org http://www.msjogren.net/dotnet/ | http://www.dotnetinterop.com Please reply only to the newsgroup.
Tom,
Naming a VB.NET method op_Addition is not enough to allow C# to use the
overloaded operator.
When C# creates its overloaded + method a special IL attribute is placed on
the op_Addition method, this IL attribute can only be placed by compilers
(not angle braces, such as serializable).
For details on how overloaded operators are implemented at the IL level see: http://msdn.microsoft.com/msdnmag/is...C/default.aspx
My initial tests in Whidbey show they are using the same naming convention
for matching operators, obviously operators such as Like have no C# & C++
equivalent.
Hope this helps
Jay
"Tom Spink" <thomasdotspinkat@ntlworlddotcom> wrote in message
news:ep**************@tk2msftngp13.phx.gbl... Okay! Fair enough... but just out of interest... what is 'enough'?
-- HTH, -- Tom Spink, Über Geek
Woe be the day VBC.EXE says, "OrElse what?"
Please respond to the newsgroup, so all can benefit "Mattias Sjögren" <ma********************@mvps.org> wrote in message news:OH**************@TK2MSFTNGP10.phx.gbl... Tom,
You can actually implement operator overloading routines,
No you can't. You can consume most operator functions defined in other languages, but you can't define your own. Just giving it the right name (the op_ prefix) isn't enough. Mattias
-- Mattias Sjögren [MVP] mattias @ mvps.org http://www.msjogren.net/dotnet/ | http://www.dotnetinterop.com Please reply only to the newsgroup.
Intriguing... Thanks :)
--
HTH,
-- Tom Spink, Über Geek
Woe be the day VBC.EXE says, "OrElse what?"
Please respond to the newsgroup,
so all can benefit
"Jay B. Harlow [MVP - Outlook]" <Ja************@msn.com> wrote in message
news:u2**************@TK2MSFTNGP09.phx.gbl... Tom, Naming a VB.NET method op_Addition is not enough to allow C# to use the overloaded operator.
When C# creates its overloaded + method a special IL attribute is placed
on the op_Addition method, this IL attribute can only be placed by compilers (not angle braces, such as serializable).
For details on how overloaded operators are implemented at the IL level
see: http://msdn.microsoft.com/msdnmag/is...C/default.aspx
My initial tests in Whidbey show they are using the same naming convention for matching operators, obviously operators such as Like have no C# & C++ equivalent.
Hope this helps Jay
"Tom Spink" <thomasdotspinkat@ntlworlddotcom> wrote in message news:ep**************@tk2msftngp13.phx.gbl... Okay! Fair enough... but just out of interest... what is 'enough'?
-- HTH, -- Tom Spink, Über Geek
Woe be the day VBC.EXE says, "OrElse what?"
Please respond to the newsgroup, so all can benefit "Mattias Sjögren" <ma********************@mvps.org> wrote in message news:OH**************@TK2MSFTNGP10.phx.gbl... Tom,
>You can actually implement operator overloading routines,
No you can't. You can consume most operator functions defined in other languages, but you can't define your own. Just giving it the right name (the op_ prefix) isn't enough. Mattias
-- Mattias Sjögren [MVP] mattias @ mvps.org http://www.msjogren.net/dotnet/ | http://www.dotnetinterop.com Please reply only to the newsgroup.
This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: Edward Diener |
last post by:
Is there a way to override the default processing of the assignment operator
for one's own __value types ? I realize I can program my own Assign method,
and provide that for end-users of my class,...
|
by: Pmb |
last post by:
I've been working on creating a Complex class for my own learning purpose
(learn through doing etc.). I'm once again puzzled about something. I can't
figure out how to overload the assignment...
|
by: gorda |
last post by:
Hello,
I am playing around with operator overloading and inheritence,
specifically overloading the + operator in the base class and its
derived class.
The structure is simple: the base class...
|
by: pmatos |
last post by:
Hi all,
I'm overloading operator<< for a lot of classes. The question is about
style. I define in each class header the prototype of the overloading
as a friend. Now, where should I define the...
|
by: carlos |
last post by:
Curious:
Why wasnt a primitive exponentiation operator not added to C99?
And, are there requests to do so in the next std revision?
Justification for doing so:
C and C++ are increasingly used...
|
by: karthik |
last post by:
The * operator behaves in 2 different ways. It is used as the value at
address operator as well as the multiplication operator. Does this mean
* is overloaded in c?
|
by: Jerry Fleming |
last post by:
As I am newbie to C++, I am confused by the overloading issues. Everyone
says that the four operators can only be overloaded with class member
functions instead of global (friend) functions: (), ,...
|
by: y-man |
last post by:
Hi,
I am trying to get an overloaded operator to work inside the class it
works on. The situation is something like this:
main.cc:
#include "object.hh"
#include "somefile.hh"
object obj,...
|
by: sturlamolden |
last post by:
Python allows the binding behaviour to be defined for descriptors,
using the __set__ and __get__ methods. I think it would be a major
advantage if this could be generalized to any object, by...
|
by: Wayne Shu |
last post by:
Hi everyone, I am reading B.S. 's TC++PL (special edition).
When I read chapter 11 Operator Overloading, I have two questions.
1. In subsection 11.2.2 paragraph 1, B.S. wrote "In particular,...
|
by: CloudSolutions |
last post by:
Introduction:
For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
|
by: Faith0G |
last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...
|
by: ryjfgjl |
last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
by: ryjfgjl |
last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
|
by: ryjfgjl |
last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
|
by: Sonnysonu |
last post by:
This is the data of csv file
1 2 3
1 2 3
1 2 3
1 2 3
2 3
2 3
3
the lengths should be different i have to store the data by column-wise with in the specific length.
suppose the i have to...
|
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...
| |