| 858 | */ |
| 859 | template <class T> |
| 860 | inline typename array_of_trait<T>::return_type get_array_of() const |
| 861 | { |
| 862 | std::vector<T> result; |
| 863 | result.reserve(values_.size()); |
| 864 | |
| 865 | for (const auto& val : values_) |
| 866 | { |
| 867 | if (auto v = val->as<T>()) |
| 868 | result.push_back(v->get()); |
| 869 | else |
| 870 | return {}; |
| 871 | } |
| 872 | |
| 873 | return {std::move(result)}; |
| 874 | } |
| 875 | |
| 876 | /** |
| 877 | * Obtains an array of arrays. Note that elements may be nullptr |