boostorg / wave

Boost.org wave module
http://boost.org/libs/wave
21 stars 49 forks source link

Use `boost::allocator_max_size` for `SmallStringOpt` to obtain allocator's max size #173

Closed frederick-vs-ja closed 2 years ago

frederick-vs-ja commented 2 years ago

Since direct call to a.max_size() may fail to compile since C++11.

I found the fix was missing for SmallStringOpt when building a project at work in C++20 mode (where std::allocator's max_size is removed).

Related to #85, #86, #93.

jefftrull commented 2 years ago

Wave requires C++11 since 1.79 - maybe we can just use std::allocator_traits<> ?

frederick-vs-ja commented 2 years ago

Wave requires C++11 since 1.79 - maybe we can just use std::allocator_traits<> ?

I think this is OK. But doing so would partially revert the changes in #93, and might violate @glenfe's intent.

jefftrull commented 2 years ago

Yes, I think you are right. There is little practical benefit to switching to std::allocator_traits and a bit of work. Making this update maintains consistency with the existing code, as well.

hkaiser commented 2 years ago

@jefftrull Thanks a lot!