From da1258e2e679bc8b9471b5d9ff35d8473e76e062 Mon Sep 17 00:00:00 2001 From: Jay Berkenbilt Date: Fri, 3 Apr 2020 12:06:14 -0400 Subject: Update C++11 notes in TODO --- TODO | 36 ++++++++++++++++-------------------- 1 file changed, 16 insertions(+), 20 deletions(-) diff --git a/TODO b/TODO index 7ca0db92..426bf9b3 100644 --- a/TODO +++ b/TODO @@ -34,32 +34,28 @@ Comments appear in the code prefixed by "ABI" C++-11 ====== -* My c++11 branch adds re-implements PointerHolder so that it is - interchangeable with std::shared_ptr. It is not actually possible to - just replace PointerHolder with std::shared_ptr for two reasons: - there is no automatic creation of std::shared_ptr from T* like - there is for PointerHolder, which breaks some code, and also there - is no automatic conversion from something like - std::vector> to std::vector>. It - may be a good idea to replace PointerHolder with std::shared_ptr in - the API even if it requires some work for the developer, but even if - that isn't worth it, we should find all occurrences of PointerHolder - within the code and replace with std::shared_ptr or std::unique_ptr - as needed. This will definitely break binary compatibility as the - PointerHolder pattern is part of the ABI for almost every - class. - -* QIntC.hh could be simplified with type_traits. - * Search for ::iterator and ::const_iterator and replace with either auto or foreach-style iteration. * There may be some places where std::function and lambdas can simplify handlers rather than using classes with apply methods. -* Find places where we declare but don't define copy and assignment - and replace with deleted methods to move errors from link to compile - time. +* My c++11 branch adds re-implements PointerHolder so that it is + interchangeable with std::shared_ptr. We may not actually want to + ever do this because it turns out PointerHolder is slightly more + performant than std::shared_ptr, at least as of g++ 9.2.1. It is not + actually possible to just replace PointerHolder with std::shared_ptr + for two reasons: there is no automatic creation of + std::shared_ptr from T* like there is for PointerHolder, which + breaks some code, and also there is no automatic conversion from + something like std::vector> to + std::vector>. It may be a good idea to replace + PointerHolder with std::shared_ptr in the API even if it requires + some work for the developer, but even if that isn't worth it, we + should find all occurrences of PointerHolder within the code and + replace with std::shared_ptr or std::unique_ptr as needed. This will + definitely break binary compatibility as the PointerHolder + pattern is part of the ABI for almost every class. Page splitting/merging -- cgit v1.2.3-54-g00ecf