From 54e63082191f337084f96083ca90d7c35273d6ff Mon Sep 17 00:00:00 2001 From: bungeman Date: Wed, 6 Jan 2016 08:30:59 -0800 Subject: [PATCH] Add skstd::remove_pointer_t and use it. This replaces an existing incomplete implementation. This also makes it easier to update the current use in the future when switching to . Review URL: https://codereview.chromium.org/1555153002 --- include/private/SkTLogic.h | 1 + src/ports/SkFontMgr_android_parser.cpp | 6 ++---- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/include/private/SkTLogic.h b/include/private/SkTLogic.h index 8d07ba1d38..0ca0d0f11b 100644 --- a/include/private/SkTLogic.h +++ b/include/private/SkTLogic.h @@ -31,6 +31,7 @@ template using enable_if_t = typename std::enable_if template using remove_const_t = typename std::remove_const::type; template using remove_volatile_t = typename std::remove_volatile::type; template using remove_cv_t = typename std::remove_cv::type; +template using remove_pointer_t = typename std::remove_pointer::type; template using remove_reference_t = typename std::remove_reference::type; template using remove_extent_t = typename std::remove_extent::type; diff --git a/src/ports/SkFontMgr_android_parser.cpp b/src/ports/SkFontMgr_android_parser.cpp index ba2296bffa..29ea52523d 100644 --- a/src/ports/SkFontMgr_android_parser.cpp +++ b/src/ports/SkFontMgr_android_parser.cpp @@ -12,6 +12,7 @@ #include "SkTDArray.h" #include "SkTSearch.h" #include "SkTemplates.h" +#include "SkTLogic.h" #include #include @@ -579,9 +580,6 @@ static const XML_Memory_Handling_Suite sk_XML_alloc = { sk_free }; -template struct remove_ptr {typedef T type;}; -template struct remove_ptr {typedef T type;}; - /** * This function parses the given filename and stores the results in the given * families array. Returns the version of the file, negative if the file does not exist. @@ -598,7 +596,7 @@ static int parse_config_file(const char* filename, SkTDArray& famil return -1; } - SkAutoTCallVProc::type, XML_ParserFree> parser( + SkAutoTCallVProc, XML_ParserFree> parser( XML_ParserCreate_MM(nullptr, &sk_XML_alloc, nullptr)); if (!parser) { SkDebugf(SK_FONTMGR_ANDROID_PARSER_PREFIX "could not create XML parser\n");