|
|
Le 21/04/2012 23:37, Orchid Win7 v1 nous fit lire :
> "override operator;".
are you sure you do not want "operator," instead ?
For once, I'm glad C++ does not allow such!
The overloading (?) of << and >> is already enough trauma when dealing
with streams... or not.
c = ceo << eke ;
d = kaz << ekk ;
one is a shift operation, the other is write in a stream... can you say
which one ? (and either c is an integer or a stream...)
in fact, monade seems to be the << with polymorphic type added.
(for streams, << returns a reference to updated stream (sort of), so
cout << "hello " << "world" << endl;
is in fact ((cout << "hello") << "world ) << endl;
Now, if << is specified to return not the same reference type as the one
on the left, it can become "interesting".
But of course, then, we need a template to declare the << for the part
on right... or a lot of overloading.
I wonder if there is a deep difference between haskell & forth... or a
bit of lisp. Just that haskell dropped all ()...
Post a reply to this message
|
|