Re: Operator Overloading <<



On 9/29/05, matt.hulse@xxxxxxxxx <matt.hulse@xxxxxxxxx> wrote:
> Is there a way to overload '<<' in the Array class?
>
> Or perhaps there's a better approach to my problem. I have a class
> that inherits from Array. I want the user to be able to use my class
> just like a standard array. However, I want to be able to force some
> code to run every time a user of my class appends a new item. I was
> able to overload the '+' operator to do this but it doesn't fit with
> standard array usage.

It's generally not considered a good idea to overload. Consider using
Delegate instead.

-austin
--
Austin Ziegler * halostatue@xxxxxxxxx
* Alternate: austin@xxxxxxxxxxxxx


.



Relevant Pages

  • Re: A good data structure to store INI files.
    ... },{#Second Ship ... But I would need overload for that, and I could save it into an array for the order and a hash for quick lookup. ...
    (comp.lang.perl.misc)
  • Re: Operator Overloading <<
    ... >>> that inherits from Array. ... >>> just like a standard array. ... > providing your own implementation of a super class method in a derived ...
    (comp.lang.ruby)
  • Could use some help...:)
    ... I need to overload the ... intended to contain a 2d array. ... keyboard in the constructor ... ---as a member of class A? ...
    (comp.lang.cpp)
  • RE: Error MSDAAB ExecuteDataset
    ... SqlHelper.ExecuteDataSet method to execute a stored procedure which fills a ... It is an object array. ... it is calling this overload: ... you turn in on in the project setting page, you will see the error for ...
    (microsoft.public.dotnet.framework.adonet)
  • Re: [C++] Char pointers for memory blocks
    ... > Array a; ... > This translates to (the compiler translates this to): ... >> So lets say we want to overload the array subscript operator and make ... > that you need both he const and non-const version. ...
    (alt.comp.lang.learn.c-cpp)