Fabric: Implementation of getDebugDescription for std::array

Summary:
Yoga uses `std::array` a lot (and `std::array` is not a `std::vector`), so it's useful for printing Yoga values.

Changelog: [Internal] Fabric-specific internal change.

Reviewed By: mdvacca

Differential Revision: D21028570

fbshipit-source-id: c6bf114d5362f085ea201ecdc5b7d59646b33ebd
This commit is contained in:
Valentin Shergin
2020-04-17 21:17:31 -07:00
committed by Facebook GitHub Bot
parent cc07baa87e
commit e1eef24321
@@ -302,6 +302,23 @@ std::vector<T, Ts...> getDebugChildren(
return vector;
}
// `std::array<T, Size>`
template <typename T, size_t Size>
std::string getDebugName(std::array<T, Size> const &array) {
return "List";
}
template <typename T, size_t Size>
std::vector<T> getDebugChildren(
std::array<T, Size> const &array,
DebugStringConvertibleOptions options) {
auto vector = std::vector<T>{};
for (auto const &value : array) {
vector.push_back(value);
}
return vector;
}
// `std::unordered_set<T>`
template <typename T, typename... Ts>
std::string getDebugName(std::unordered_set<T, Ts...> const &set) {