| 543 | template <typename T, typename = typename std::enable_if< |
| 544 | std::is_fundamental<T>::value, void>::type> |
| 545 | array(std::initializer_list<T> list) |
| 546 | : arr(nullptr) { |
| 547 | dim_t size = list.size(); |
| 548 | if (af_err __aferr = af_create_array(&arr, list.begin(), 1, &size, |
| 549 | static_cast<af_dtype>(af::dtype_traits<T>::af_type))) { |
| 550 | char *msg = NULL; |
| 551 | af_get_last_error(&msg, NULL); |
| 552 | af::exception ex(msg, __PRETTY_FUNCTION__, "include/af/array.h", |
| 553 | __LINE__, __aferr); |
| 554 | af_free_host(msg); |
| 555 | throw std::move(ex); |
| 556 | } |
| 557 | } |
| 558 | |
| 559 | /// \brief Initializer list constructor |
| 560 | template <typename T, typename = typename std::enable_if< |
no test coverage detected