Skip to content

Commit

Permalink
Bug 1828784 - Work around VS 2019+ SDK issue. r=glandium
Browse files Browse the repository at this point in the history
This is enough to prevent the undesired instantiation.

Differential Revision: https://phabricator.services.mozilla.com/D175920
  • Loading branch information
emilio committed Apr 19, 2023
1 parent a73c63f commit b8f531e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
4 changes: 2 additions & 2 deletions js/public/GCVector.h
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,8 @@ class GCVector {
public:
using ElementType = T;

explicit GCVector(AllocPolicy alloc = AllocPolicy())
: vector(std::move(alloc)) {}
explicit GCVector(AllocPolicy alloc) : vector(std::move(alloc)) {}
GCVector() : GCVector(AllocPolicy()) {}

GCVector(GCVector&& vec) : vector(std::move(vec.vector)) {}

Expand Down
7 changes: 4 additions & 3 deletions mfbt/Vector.h
Original file line number Diff line number Diff line change
Expand Up @@ -341,9 +341,8 @@ template <typename T, size_t MinInlineCapacity = 0,
class AllocPolicy = MallocAllocPolicy>
class MOZ_NON_PARAM Vector final : private AllocPolicy {
/* utilities */

static constexpr bool kElemIsPod =
std::is_trivial<T>::value && std::is_standard_layout<T>::value;
std::is_trivial_v<T> && std::is_standard_layout_v<T>;
typedef detail::VectorImpl<T, MinInlineCapacity, AllocPolicy, kElemIsPod>
Impl;
friend struct detail::VectorImpl<T, MinInlineCapacity, AllocPolicy,
Expand Down Expand Up @@ -540,7 +539,9 @@ class MOZ_NON_PARAM Vector final : private AllocPolicy {

typedef T ElementType;

explicit Vector(AllocPolicy = AllocPolicy());
explicit Vector(AllocPolicy);
Vector() : Vector(AllocPolicy()) {}

Vector(Vector&&); /* Move constructor. */
Vector& operator=(Vector&&); /* Move assignment. */
~Vector();
Expand Down

0 comments on commit b8f531e

Please sign in to comment.