Boost logo

Boost :

Subject: Re: [boost] Request for help in porting colony to boost from experienced container boost dev
From: Soul Studios (matt_at_[hidden])
Date: 2015-08-28 19:18:12


> When you write application code, you're free to do what you want (and
> avoid caring about exception handling entirely). When you write
> library code, you're not. You may have people consuming your library
> code who have exception handling needs that are not your own. Look at
> the two possible implementations of f() below. Mike isn't telling you
> to put the former in public/library code over the latter:

As I said, that's fine - Colony was originally conceived for games work,
so some of the attitudinal approach comes from there.

>> If you could help me with some basic code here, I'd appreciate it-
>> I understand what you're saying, but am unsure whether you're meaning to
>> wrap the allocator instance, or something else entirely.
>
> Look up boost::compressed_pair or the EBO, give it an attempt, and we
> can review it. I hope that you understand the issue, though. Consider

I do understand the issue and want to address it, so to be clear, you
are talking about wrapping the following and other rebinds:

> element_allocator_type a;

?
BTW I didn't actually get an answer to the following:

>>> 2. Use allocator_traits<A>::construct(a, ...) and
>>> >>allocator_traits<A>::destroy(a) instead of a.construct(...) and
>>> >>a.destroy(...)
>> >
>> >Why, and is there a C++0x-friendly way of doing the same thing?
> std::allocator_traits is the C++11 and above way of doing things.

I get that using allocator_traits seems to be the preferred C++11 way of
doing things but I don't know why?

Also can I use boost::allocator_traits to do the same thing in
C++0x-friendly code?


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk