Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

override operator new cause error when export Constructor #17

Closed
greyhu opened this issue Oct 16, 2014 · 1 comment
Closed

override operator new cause error when export Constructor #17

greyhu opened this issue Oct 16, 2014 · 1 comment
Labels

Comments

@greyhu
Copy link

greyhu commented Oct 16, 2014

If a class override the operator new(this is normal when using some kind of memory pool),when export the Constructor, it'll triggeran error:
'operator new' : function does not take 2 arguments

To be sure to use the global allocation function,the placement new should explicit use ::new.

patch:
CppInvoke.h
static T* call(void* mem, TUPLE& args)
{
-return new (mem) T(std::get(args).value()...);
+return ::new (mem) T(std::get(args).value()...);
}

@SteveKChiu
Copy link
Owner

Thanks for pointing this out, I will get this fixed soon.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants