[PATCH] D55005: Avoid redundant reference to isPodLike in SmallVect implementation
Phabricator via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Thu Nov 29 09:24:52 PST 2018
This revision was automatically updated to reflect the committed changes.
Closed by commit rL347890: Avoid redundant reference to isPodLike in SmallVect/Optional implementation (authored by serge_sans_paille, committed by ).
Herald added subscribers: llvm-commits, kristina.
Changed prior to commit:
https://reviews.llvm.org/D55005?vs=175856&id=175885#toc
Repository:
rL LLVM
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D55005/new/
https://reviews.llvm.org/D55005
Files:
llvm/trunk/include/llvm/ADT/Optional.h
llvm/trunk/include/llvm/ADT/SmallVector.h
Index: llvm/trunk/include/llvm/ADT/SmallVector.h
===================================================================
--- llvm/trunk/include/llvm/ADT/SmallVector.h
+++ llvm/trunk/include/llvm/ADT/SmallVector.h
@@ -182,7 +182,7 @@
/// SmallVectorTemplateBase<isPodLike = false> - This is where we put method
/// implementations that are designed to work with non-POD-like T's.
-template <typename T, bool isPodLike>
+template <typename T, bool = isPodLike<T>::value>
class SmallVectorTemplateBase : public SmallVectorTemplateCommon<T> {
protected:
SmallVectorTemplateBase(size_t Size) : SmallVectorTemplateCommon<T>(Size) {}
@@ -320,8 +320,8 @@
/// This class consists of common code factored out of the SmallVector class to
/// reduce code duplication based on the SmallVector 'N' template parameter.
template <typename T>
-class SmallVectorImpl : public SmallVectorTemplateBase<T, isPodLike<T>::value> {
- using SuperClass = SmallVectorTemplateBase<T, isPodLike<T>::value>;
+class SmallVectorImpl : public SmallVectorTemplateBase<T> {
+ using SuperClass = SmallVectorTemplateBase<T>;
public:
using iterator = typename SuperClass::iterator;
Index: llvm/trunk/include/llvm/ADT/Optional.h
===================================================================
--- llvm/trunk/include/llvm/ADT/Optional.h
+++ llvm/trunk/include/llvm/ADT/Optional.h
@@ -29,7 +29,7 @@
namespace optional_detail {
/// Storage for any type.
-template <typename T, bool IsPodLike> struct OptionalStorage {
+template <typename T, bool = isPodLike<T>::value> struct OptionalStorage {
AlignedCharArrayUnion<T> storage;
bool hasVal = false;
@@ -111,7 +111,7 @@
} // namespace optional_detail
template <typename T> class Optional {
- optional_detail::OptionalStorage<T, isPodLike<T>::value> Storage;
+ optional_detail::OptionalStorage<T> Storage;
public:
using value_type = T;
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D55005.175885.patch
Type: text/x-patch
Size: 1886 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20181129/a7d7cce3/attachment.bin>
More information about the llvm-commits
mailing list