You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Apr 20, 2024. It is now read-only.
In pt::malloc_allocator<T, true, true> VS does not (fully) apply empty base class optimization. This reddit post gives a solution for VS2015/U2+ https://www.reddit.com/r/cpp/comments/45bvku/msvc_finally_gets_variable_templates_and_optin/ (please note that __declspec(emptyBases) should be __declspec(empty_bases))
The signature:
template <class T, bool make_reallocable = true, bool make_size_aware = false>
struct malloc_allocator: public std::conditional<make_reallocable, reallocable_allocator, internals::dummy1>::type
#ifdef PT_SIZE_AWARE_COMPAT
, public std::conditional<make_size_aware, size_aware_allocator, internals::dummy2>::type
#endif
should be changed to:
template <class T, bool make_reallocable = true, bool make_size_aware = false>
struct __declspec( empty_bases ) malloc_allocator: public std::conditional<make_reallocable, reallocable_allocator, internals::dummy1>::type
#ifdef PT_SIZE_AWARE_COMPAT
, public std::conditional<make_size_aware, size_aware_allocator, internals::dummy2>::type
#endif
The text was updated successfully, but these errors were encountered: