boostorg / wave

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

Fix more allocator traits #85

Closed jefftrull closed 4 years ago

jefftrull commented 4 years ago

If merged this will resolve #84. Thanks to @qis for the assistance.

glenfe commented 4 years ago

@jefftrull Something like:

namespace boost {
namespace wave {
namespace util {

#if !defined(BOOST_NO_CXX11_ALLOCATOR)
using std::allocator_traits;
#else
template<class A>
struct allocator_traits {
    typedef typename A::value_type value_type;
    typedef typename A::pointer pointer;
    // Fill in the rest as needed.
};
#endif

} // util
} // wave
} // boost
jefftrull commented 4 years ago

Looks like this problem has been solved by a few other libraries and appears to be in the public interface of Container - is it worth simply using that one? https://www.boost.org/doc/libs/1_72_0/doc/html/boost/container/allocator_traits.html

glenfe commented 4 years ago

@jefftrull That would be fine too if there are no objections to Boost.Wave taking a dependency on Boost.Container (which it doesn't right now, I believe).

Lastique commented 4 years ago

@glenfe @igaztanaga Another option would be to move allocator_traits from Boost.Container to Boost.Core. There are other places where we need allocator_traits but not the rest of Boost.Container.

jefftrull commented 4 years ago

Upon reflection I don't think it makes sense to add a dependency for the benefit of this one string class within one library. Unless allocator_traits goes into Core I'll stick with a minimal local version.

jefftrull commented 4 years ago

The Travis job has been hung for > 24h so I'm just going to merge it.

glenfe commented 4 years ago

@Lastique https://github.com/boostorg/core/commit/c31e23b36294bc3958b04deef62123abce0204b9

Lastique commented 4 years ago

@glenfe Thank you Glen.

jefftrull commented 4 years ago

Will refactor to use that in 1.74.