Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon.

Pages: 1-

(2^19)+6th reason why C++ sucks

Name: RAGE 2012-02-05 11:18

error: overloaded 'operator=' must be a non-static member function

This bitch does not allow me to implement custom operator= for class that I can't modify(well, I can apt-get source or modify header files but it's too dirty).

I can overload += as static non-member function just fine.

So in other words, if I need to use Library1 that provides Vector3 and Library2 that provides VecXYZ and these libraries do not know about existence of each other I can write additional functions so vector3+vecXYZ,vector3+=vecXYZ will work but assignment is no-no. Thou shalt not write functions for converting one type of vectors to another.

WTF? Where is justice?

Name: Anonymous 2012-02-05 11:27

No one here gives a fuck about your lame attempt at a nerd adventure with a loser language.

Name: Anonymous 2012-02-05 11:48

>>2
Both Haskell and Lisp are shit.  C is undefined shit.

Name: Anonymous 2012-02-05 12:21

>>1
If C++ is too hard, you should consider Visual Basic.

WTF? Where is justice?
Eh..? It's a programming language, not some justice system. You have to follow certain rules with every programming languages. If there were justice, you would be in electric chair for trying to overload operators so recklessly.

Name: Anonymous 2012-02-05 13:05

Write a wrapper class.

Name: Anonymous 2012-02-05 14:09

Why are you even trying to use operator overloading? It's some real stupid shit.

Name: Anonymous 2012-02-05 14:37

[quote]Operator overloading[/quote]

go back to /g/ please

Name: Anonymous 2012-02-05 14:41

>>7
[quote]
Go back to /g/, please.

Name: Anonymous 2012-02-05 16:05

i'm not a c++ guy but i'm not seeing what is wrong with overloading operators for vector types

Name: Anonymous 2012-02-05 18:36

>>9
It's useful as shit but it's also implicit as shit and c++ sucks.

Name: Anonymous 2012-02-05 18:51

>>9,10
It's harmful as shit.

Name: Anonymous 2012-02-06 13:14

>>10
implicit? what?

Name: Anonymous 2012-02-06 18:17

You cannot overload ?:
I have a project that heavily depends on that and coding workarounds is just a nightmare.

Name: Anonymous 2012-02-06 18:52

>>13
I have a project that heavily depends on that and coding workarounds is just a nightmare.
Then your project is absolute shit, it's a complete piece of fucking crap.

Name: Anonymous 2012-02-06 19:01

>>13
Just overload operator bool() for the condition's type and make sure the second and third parts of the ?: are always the same type. If you're trying to give ?: any meaning other than a conditional operator then you're using it wrong.

Name: Anonymous 2012-02-06 19:05

>>14
Well thank you. If you cannot imaging a project using such arithmetic then it is more of a reflection of your own shortcoming.

Name: Anonymous 2012-02-06 19:09

This just sounds like some lame nerd adventure in a loser language that no one here gives a shit about.

Name: Anonymous 2012-02-06 19:13

>>17
Shut up Kodak. You didn't even read the C standard.

Name: Anonymous 2012-02-06 19:23

>>18
Execuse me bitch, but I believe I was the first one to point out that the C standard existed.

Name: Anonymous 2012-02-06 23:59

Simply use the friend operator to break all conventions about information hiding and object oriented programming.

Name: Anonymous 2012-02-07 13:22

I can't believe the retardation of OP. Consider a situation where you'd be using both vector types. Now imagine how INCREDIBLY FUCKING CONFUSING it would be for anyone else (and YOU) reading your program, to see a vector that is obviously of type VecXYZ, being assigned the value of a Vector3.

operator= in C++ is for assigning values, not for implicit typecasting. It's people like you have given operator overloading the bad rap it has. If you want to convert VecXYZ to Vector3, write a vecXyzToVector3() function.

Seriously, fuck.

Name: Anonymous 2012-02-07 13:25

>>21
In short, C++ doesn't suck. You do.

Name: Anonymous 2012-02-07 13:27

>>22
nice dubz bro

Don't change these.
Name: Email:
Entire Thread Thread List