On Monday, December 5, 2016 at 3:22:23 AM UTC-5, Öö Tiib wrote:
>
> Boost docs say that "is_stateless" is implemented like that:
>
> ::boost::has_trivial_constructor<T>::value
> && ::boost::has_trivial_copy<T>::value
> && ::boost::has_trivial_destructor<T>::value
> && ::boost::is_class<T>::value
> && ::boost::is_empty<T>::value
boost::is_stateless<std::allocator<char>>::value turns out to return false.
boost::has_trivial_constructor<T>::value and boost::has_trivial_copy<T>::value
both evaluate to false (the other parts evaluate to true.)
For my purposes, I'm tentatively using
template <typename T>
struct is_stateless_allocator
: public std::integral_constant<bool,
(std::is_default_constructible<T>::value &&
std::is_empty<T>::value)>
{};
If anyone has any suggestions for other conditions to throw in there, please
let me know.
Thanks,
Daniel