-
August 5th, 2013, 06:19 PM
#1
operator new without implementation?
Here is the code,
Code:
class A
{
private:
void* operator new(size_t size);
};
int main()
{
return 0;
}
The code above compiles fine without errors. But operator new might not have implemenation body? Thanks.
-
August 6th, 2013, 12:11 AM
#2
Re: operator new without implementation?
Try to create instance of class A.
-
August 6th, 2013, 08:13 AM
#3
Re: operator new without implementation?
Your example is really no different to
Code:
class A
{
private:
void* someFunction();
};
int main()
{
return 0;
}
If you don't try to call someFunction, or new in your case, there is no problem.
-
August 6th, 2013, 09:05 AM
#4
Re: operator new without implementation?
Originally Posted by LarryChen
Here is the code,
Code:
class A
{
private:
void* operator new(size_t size);
};
int main()
{
return 0;
}
The code above compiles fine without errors. But operator new might not have implemenation body? Thanks.
Do you work with C++ or do you just sit around trying to come up with crazy questions?
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|