diff --git a/toonz/sources/common/tfx/trenderer.cpp b/toonz/sources/common/tfx/trenderer.cpp index 60ea393..93c4ca4 100644 --- a/toonz/sources/common/tfx/trenderer.cpp +++ b/toonz/sources/common/tfx/trenderer.cpp @@ -26,9 +26,6 @@ #include #include -// tcg includes -#include "tcg/tcg_deleter_types.h" - // Debug //#define DIAGNOSTICS //#include "diagnostics.h" @@ -1384,7 +1381,7 @@ void TRendererImp::startRendering( std::vector &m_tasksVector; ~TasksCleaner() { std::for_each(m_tasksVector.begin(), m_tasksVector.end(), - tcg::deleter()); + std::default_delete()); } } tasksCleaner = {tasksVector}; diff --git a/toonz/sources/common/trop/tdespeckle.cpp b/toonz/sources/common/trop/tdespeckle.cpp index 26c3704..6bfe400 100644 --- a/toonz/sources/common/trop/tdespeckle.cpp +++ b/toonz/sources/common/trop/tdespeckle.cpp @@ -14,9 +14,6 @@ #include "borders_extractor.h" #define INCLUDE_HPP -// tcg includes -#include "tcg/deleter_types.h" - // STL includes #include @@ -273,7 +270,7 @@ public: //--------------------------------------------------------------------------------------------- DespecklingReader::~DespecklingReader() { - std::for_each(m_borders.begin(), m_borders.end(), tcg::deleter()); + std::for_each(m_borders.begin(), m_borders.end(), std::default_delete()); } //--------------------------------------------------------------------------------------------- diff --git a/toonz/sources/common/tstream/tpersistset.cpp b/toonz/sources/common/tstream/tpersistset.cpp index dde3aea..34a14a0 100644 --- a/toonz/sources/common/tstream/tpersistset.cpp +++ b/toonz/sources/common/tstream/tpersistset.cpp @@ -4,7 +4,6 @@ #include "tstream.h" // tcg includes -#include "tcg/tcg_deleter_types.h" #include "tcg/tcg_function_types.h" // STD includes @@ -21,7 +20,7 @@ PERSIST_IDENTIFIER(TPersistSet, "persistSet") //------------------------------------------------------------------ TPersistSet::~TPersistSet() { - std::for_each(m_objects.begin(), m_objects.end(), tcg::deleter()); + std::for_each(m_objects.begin(), m_objects.end(), std::default_delete()); } //------------------------------------------------------------------ @@ -38,7 +37,7 @@ void TPersistSet::insert(std::unique_ptr object) { std::remove_if(m_objects.begin(), m_objects.end(), tcg::bind1st(&locals::sameType, object.get())); - std::for_each(pt, m_objects.end(), tcg::deleter()); + std::for_each(pt, m_objects.end(), std::default_delete()); m_objects.erase(pt, m_objects.end()); // Push back the supplied object diff --git a/toonz/sources/include/tcg/deleter_types.h b/toonz/sources/include/tcg/deleter_types.h deleted file mode 100644 index 3a4a979..0000000 --- a/toonz/sources/include/tcg/deleter_types.h +++ /dev/null @@ -1,89 +0,0 @@ -#pragma once - -#ifndef TCG_DELETER_TYPES_H -#define TCG_DELETER_TYPES_H - -// tcg includes -#include "traits.h" - -/* - \file deleter_types.h - - \brief This file contains implementations of some useful deleter functors - and deleter concepts. -*/ - -namespace tcg { - -//********************************************************************************* -// Deleter objects -//********************************************************************************* - -template -struct deleter { - void operator()(T *ptr) const { delete ptr; } -}; - -template -struct deleter { - void operator()(T *ptr) const { delete[] ptr; } -}; - -template -struct dtor { - void operator()(T *ptr) const { ptr->~T(); } -}; - -template -struct dtor { - int m_count; - - dtor(int count) : m_count(count) {} - - void operator()(T *ptr) const { - for (int t = 0; t != m_count; ++t) ptr[t].~T(); - } -}; - -struct freer { - void operator()(void *ptr) const { free(ptr); } -}; - -/*! - The Deleter concept can be used to destroy instances of incomplete types. - - Deleter objects are useful in all cases where a type-erasure concept needs - to support specialization on incomplete types. -*/ - -template -class deleter_concept { -public: - typedef typename tcg::traits::pointer_type pointer_type; - -public: - virtual ~deleter_concept() {} - - virtual deleter_concept *clone() const = 0; - virtual void operator()(pointer_type ptr) = 0; -}; - -//-------------------------------------------------------------------------------- - -template -class deleter_model : public deleter_concept { -public: - deleter_concept *clone() const { return new deleter_model(*this); } - void operator()(T *ptr) { delete ptr; } -}; - -template -class deleter_model : public deleter_concept { -public: - deleter_concept *clone() const { return new deleter_model(*this); } - void operator()(T *ptr) { delete[] ptr; } -}; - -} // namespace tcg - -#endif // TCG_DELETER_TYPES_H diff --git a/toonz/sources/include/tcg/tcg_deleter_types.h b/toonz/sources/include/tcg/tcg_deleter_types.h deleted file mode 100644 index e3bcfa2..0000000 --- a/toonz/sources/include/tcg/tcg_deleter_types.h +++ /dev/null @@ -1,3 +0,0 @@ -#pragma once - -#include "deleter_types.h" diff --git a/toonz/sources/tnztools/tooloptions.cpp b/toonz/sources/tnztools/tooloptions.cpp index dbc4cce..3a0a997 100644 --- a/toonz/sources/tnztools/tooloptions.cpp +++ b/toonz/sources/tnztools/tooloptions.cpp @@ -60,9 +60,6 @@ #include #include -// tcg includes -#include "tcg/tcg_deleter_types.h" - TEnv::IntVar ArrowGlobalKeyFrame("EditToolGlobalKeyFrame", 0); //============================================================================= @@ -126,8 +123,8 @@ ToolOptionsBox::ToolOptionsBox(QWidget *parent, bool isScrollable) ToolOptionsBox::~ToolOptionsBox() { std::for_each(m_controls.begin(), m_controls.end(), - tcg::deleter()); - std::for_each(m_labels.begin(), m_labels.end(), tcg::deleter()); + std::default_delete()); + std::for_each(m_labels.begin(), m_labels.end(), std::default_delete()); } //----------------------------------------------------------------------------- diff --git a/toonz/sources/toonzqt/freelayout.cpp b/toonz/sources/toonzqt/freelayout.cpp index b04bb84..720b769 100644 --- a/toonz/sources/toonzqt/freelayout.cpp +++ b/toonz/sources/toonzqt/freelayout.cpp @@ -2,8 +2,7 @@ #include "toonzqt/freelayout.h" -// tcg includes -#include "tcg/tcg_deleter_types.h" +#include //************************************************************************************ // DummyLayout implementation @@ -14,7 +13,7 @@ DummyLayout::DummyLayout() { setSizeConstraint(QLayout::SetNoConstraint); } //--------------------------------------------------------------------------- DummyLayout::~DummyLayout() { - std::for_each(m_items.begin(), m_items.end(), tcg::deleter()); + std::for_each(m_items.begin(), m_items.end(), std::default_delete()); } //---------------------------------------------------------------------------