Cannot Overload sizeof Operator in C++ Why?
-
Hello friends, In operator overloading concept in c++ ,certain operators such as sizeof : sizeof operator . : membershsip operator .* : pointer to member operator :: : scope resolution operator ?: : conditional operator cannot be overload in c++ , why it so ?? What is the technical reason behind it feature in c++? -PHIJO MATHEW PHILP.:) -PHIJO MATHEW PHILP.:)
-
Hello friends, In operator overloading concept in c++ ,certain operators such as sizeof : sizeof operator . : membershsip operator .* : pointer to member operator :: : scope resolution operator ?: : conditional operator cannot be overload in c++ , why it so ?? What is the technical reason behind it feature in c++? -PHIJO MATHEW PHILP.:) -PHIJO MATHEW PHILP.:)
You don't know where to start ? ask a good friend
-
You don't know where to start ? ask a good friend
One thing that it does not mention is that
sizeof
can be (or always is?) evaluated at compile time (at least by some compiler implementations). This would not be possible if it was overloaded, which requires runtime. Peace!-=- James
If you think it costs a lot to do it right, just wait until you find out how much it costs to do it wrong!
Avoid driving a vehicle taller than you and remember that Professional Driver on Closed Course does not mean your Dumb Ass on a Public Road!
DeleteFXPFiles & CheckFavorites (Please rate this post!)