-
Notifications
You must be signed in to change notification settings - Fork 903
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
Overriding make_unique and default_delete #525
Comments
make_unique is by definition a utillity to create a new-ed object, which will be deleted by a call to delete. (although eastl::make_unique doesn't perfectly mirror the std::make_unique) the standard proposal that added std::make_unique has a good explanation on why users should simply create their own utility function if they want to use their own allocator & deleter. Specifically, see section 3.4. |
Understood. But wouldn't it make more sense to at least make them use the default allocator? This would ensure the entire library has a single default point of allocation, according to the FAQ: |
There is no way to directly override allocation in
make_unique
anddefault_delete
.They directly call standard operators, requiring having custom deleters everywhere or editing the source code when integrating EASTL into any project which involves dynamic linking (as overriding new and delete is not supported for DLLs).
Making them use the default allocator is one very simple solution which would at least provide the same allocation as other EASTL types.
The text was updated successfully, but these errors were encountered: