Re: Scope Resolution Operator

From: Dan W. (danw_at_raytron-controls.com)
Date: 12/12/03


Date: Fri, 12 Dec 2003 00:26:51 -0500

On Fri, 12 Dec 2003 04:56:58 GMT, exits funnel
<exitsfunnel@NOSPAMyahoo.com> wrote:

>Hello,
>
>I'm confused by the use of the Scope resolution operator on the

There's no such thing as a 'scope resolution operator'.

>indicated lines in the following code (which was copied from Thinking in
>C++ by Bruce Eckel). Removing them seems to have no effect.

You haven't used Widget, that's why there's no effect. Try using it
and you'll see....

>
>//Begin Code
>#include <new> // Size_t definition
>#include <fstream>
>using namespace std;
>
>class Widget {
> enum { sz = 10 };
> int i[sz];
>public:
> Widget() { }
> ~Widget() { }
> void* operator new(size_t sz) {
> return ::new char[sz]; //I'm confused here
> }
> void operator delete(void* p) {
> ::delete []p; //and here
> }
> void* operator new[](size_t sz) {
> return ::new char[sz];// and here
> }
> void operator delete[](void* p) {
> ::delete []p; //yup, here as well.
> }
>};
>int main() { }
>//END Code
>
>Thanks in advance for any replies!
>
>-exits