Skip to content

Remove trait HasEnum from struct definition Array<T> #274

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jan 20, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions src/core/array.rs
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,10 @@ extern "C" {

/// A multidimensional data container
///
/// Currently, Array objects can store only data until four dimensions
/// Currently, `Array<T>` objects support data up to four dimensions.
///
/// All operations on arrays (including creation) require that `T: HasAfEnum`,
/// meaning that `T` must be one of the numerical datatypes supported by Arrayfire.
///
/// ## Sharing Across Threads
///
Expand All @@ -161,7 +164,7 @@ extern "C" {
/// All operators(traits) from std::ops module implemented for Array object
/// carry out element wise operations. For example, `*` does multiplication of
/// elements at corresponding locations in two different Arrays.
pub struct Array<T: HasAfEnum> {
pub struct Array<T> {
handle: af_array,
/// The phantom marker denotes the
/// allocation of data on compute device
Expand Down Expand Up @@ -707,10 +710,7 @@ where
}

/// To free resources when Array goes out of scope
impl<T> Drop for Array<T>
where
T: HasAfEnum,
{
impl<T> Drop for Array<T> {
fn drop(&mut self) {
unsafe {
let ret_val = af_release_array(self.handle);
Expand Down