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

Compile time error with conflict between '#define delete' and C 11 Mutex copy-constructor deletion ('= delete;') #210

Closed
vlmillet opened this issue Jul 23, 2021 · 2 comments

Comments

@vlmillet
Copy link

There is a strange #define delete in IMemory.h which, when included before IThread.h enters in collision with MutexLock(const MutexLock& rhs) = delete; (C 11). Redefining delete is something that should be avoided IMHO to avoid this kind of difficult-to-track compilation failures : VS studio does not get you to the original #define and just prompt a static_assert.

@manas-kulkarni
Copy link

Yes. It is to discourage using the C/C memory allocation/deallocation functions directly and instead use the tf_ variants. If you notice, IMemory.h is always included last in all source files. That should fix the error. If for some reason you are forced to include IMemory.h in a header file, there is a macro you can set - IMEMORY_FROM_HEADER

@wolfgangfengel
Copy link
Contributor

Usage as intended ...

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

No branches or pull requests

3 participants