[cfe-dev] __vector_base::__destruct_at_end

Shriramana Sharma samjnaa at gmail.com
Wed Jun 26 08:15:09 PDT 2013


Hi and thank you very much for your reply.

On Wed, Jun 26, 2013 at 8:29 PM, Howard Hinnant <hhinnant at apple.com> wrote:
>> void __destruct_at_end(const_pointer __new_last, true_type) _NOEXCEPT;
>> __destruct_at_end(const_pointer __new_last, false_type)
>
> This is an optimization that I found was not working, so I disabled it with the intent of pulling it out completely if the disabilization went well.  It has, I'll pull it out.

So which of the two will remain? Do I presume the false_type version?
(And I presume the true_type/false_type thing is an idiom to avoid
creating a differently named delegate function? But a differently
named delegate may clarify the purpose of the segregation, no?)

>> Also: why separate all the containers into __container and
>> __container_base with the former inheriting from the latter? Can't it
>> be done in a single class?
>
> This is a C++03 technique for making container constructors exception safe.  Let's look at an example:

Wow very nice explanation, thank you very much! I much prefer the
try-catch model. Why isn't it then preferred in the libc++
implemented? IMO less convoluted, and would avoid lots of base::method
calls, no?

Thanks again!

-- 
Shriramana Sharma ஶ்ரீரமணஶர்மா श्रीरमणशर्मा




More information about the cfe-dev mailing list