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

Usage of uses_allocator needs a remove_cvref_t #160

Closed
vinniefalco opened this issue Aug 29, 2020 · 1 comment
Closed

Usage of uses_allocator needs a remove_cvref_t #160

vinniefalco opened this issue Aug 29, 2020 · 1 comment

Comments

@vinniefalco
Copy link
Member

vinniefalco commented Aug 29, 2020

This specialization of boost::container::uses_allocator:

template<class T>
struct uses_allocator<
    ::boost::json::value,
    json::polymorphic_allocator<T>>
        : std::true_type
{
};

fails, because Boost.Container does not use remove_cvref on the allocator. This causes uses_allocator to receive json::polymorphic_allocator<T>&

However if I use this workaround:

template<class T>
struct uses_allocator<
    ::boost::json::value,
    json::polymorphic_allocator<T>& > // <---- note the reference
        : std::true_type
{
};

it works correctly. The problem is here (and is likely in other places). I believe remove_cvref_t<ArgAlloc> is needed:

, dtl::not_< uses_allocator<T, ArgAlloc> >

@igaztanaga
Copy link
Member

Thanks for the report!

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

2 participants