2018-11-30 22:52:05 +03:00
|
|
|
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*-
|
2018-11-30 18:39:55 +03:00
|
|
|
* vim: set ts=8 sts=2 et sw=2 tw=80:
|
2012-05-21 15:12:37 +04:00
|
|
|
* This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
|
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
2009-07-01 04:19:42 +04:00
|
|
|
|
2013-06-20 04:59:09 +04:00
|
|
|
#ifndef js_Vector_h
|
|
|
|
#define js_Vector_h
|
2009-07-01 04:19:42 +04:00
|
|
|
|
2013-07-10 03:33:29 +04:00
|
|
|
#include "mozilla/Vector.h"
|
2020-03-21 17:41:09 +03:00
|
|
|
|
|
|
|
#include <type_traits>
|
|
|
|
|
2018-08-30 23:30:50 +03:00
|
|
|
#include "js/TypeDecls.h"
|
2009-08-08 07:09:11 +04:00
|
|
|
|
2009-09-02 05:46:19 +04:00
|
|
|
namespace js {
|
2009-07-01 04:19:42 +04:00
|
|
|
|
2019-10-28 01:34:11 +03:00
|
|
|
class JS_PUBLIC_API TempAllocPolicy;
|
2012-01-03 02:34:25 +04:00
|
|
|
|
2015-07-13 22:42:52 +03:00
|
|
|
namespace detail {
|
|
|
|
|
|
|
|
template <typename T>
|
2020-03-28 16:57:20 +03:00
|
|
|
struct TypeIsGCThing : std::false_type {};
|
2015-07-13 22:42:52 +03:00
|
|
|
|
2018-08-30 23:30:50 +03:00
|
|
|
template <>
|
2020-03-28 16:57:20 +03:00
|
|
|
struct TypeIsGCThing<JS::Value> : std::true_type {};
|
2015-07-13 22:42:52 +03:00
|
|
|
|
|
|
|
} // namespace detail
|
2013-07-10 03:33:29 +04:00
|
|
|
|
2012-01-03 02:34:25 +04:00
|
|
|
template <typename T, size_t MinInlineCapacity = 0,
|
2016-07-28 08:59:55 +03:00
|
|
|
class AllocPolicy = TempAllocPolicy,
|
2019-03-26 16:58:20 +03:00
|
|
|
// Don't use this with JS::Value! Use JS::RootedValueVector instead.
|
2020-03-21 17:41:09 +03:00
|
|
|
typename = std::enable_if_t<!detail::TypeIsGCThing<T>::value>>
|
2015-07-13 22:42:52 +03:00
|
|
|
using Vector = mozilla::Vector<T, MinInlineCapacity, AllocPolicy>;
|
2009-07-01 04:19:42 +04:00
|
|
|
|
2013-07-10 03:33:29 +04:00
|
|
|
} // namespace js
|
2010-08-02 18:44:24 +04:00
|
|
|
|
2013-06-20 04:59:09 +04:00
|
|
|
#endif /* js_Vector_h */
|