Strong Exception Guarantee
| 130 | |
| 131 | // Strong Exception Guarantee |
| 132 | af_err af_create_handle(af_array *result, const unsigned ndims, |
| 133 | const dim_t *const dims, const af_dtype type) { |
| 134 | try { |
| 135 | AF_CHECK(af_init()); |
| 136 | |
| 137 | if (ndims > 0) { ARG_ASSERT(2, ndims > 0 && dims != NULL); } |
| 138 | |
| 139 | dim4 d(0); |
| 140 | for (unsigned i = 0; i < ndims; i++) { d[i] = dims[i]; } |
| 141 | |
| 142 | af_array out = createHandle(d, type); |
| 143 | std::swap(*result, out); |
| 144 | } |
| 145 | CATCHALL |
| 146 | return AF_SUCCESS; |
| 147 | } |
| 148 | |
| 149 | // Strong Exception Guarantee |
| 150 | af_err af_copy_array(af_array *out, const af_array in) { |
no test coverage detected