Skip to content

Make Seq generic #57

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 3 commits into from
Feb 26, 2016
Merged

Make Seq generic #57

merged 3 commits into from
Feb 26, 2016

Conversation

tedsta
Copy link
Contributor

@tedsta tedsta commented Feb 24, 2016

No description provided.

@9prady9 9prady9 self-assigned this Feb 25, 2016
@9prady9
Copy link
Member

9prady9 commented Feb 25, 2016

Attribute feature cannot be used in stable release channel, can we use hard constants until zero and One traits are moved to stable.

Also, can you please squash the commits into single commit, the intermediate two commits don't compile by themselves. You can keep the example diff in separate commit if you prefer to.

Trying to see if we can replace traits One and Zero. Any ideas ?

@9prady9 9prady9 modified the milestone: 3.3.0 Feb 25, 2016
@@ -2,49 +2,49 @@ extern crate libc;

use std::fmt;
use std::default::Default;
use self::libc::{c_double};
use std::num::{One, Zero};

/// Sequences are used for indexing Arrays
#[derive(Copy, Clone)]
#[repr(C)]

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would you even need this anymore necessarily?

@9prady9
Copy link
Member

9prady9 commented Feb 25, 2016

@jnicholls Sure, implementing the trait ourselves is one option.

@tedsta
Copy link
Contributor Author

tedsta commented Feb 25, 2016

I updated it to implement the One and Zero traits ourselves.

}

impl Zero for u8 { fn zero() -> Self { 0 } }
impl Zero for u16 { fn zero() -> Self { 0 } }

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Boo, macro! :)

@tedsta
Copy link
Contributor Author

tedsta commented Feb 26, 2016

Alright, macros for @jnicholls :)

@9prady9
Copy link
Member

9prady9 commented Feb 26, 2016

👍

@9prady9 9prady9 added this to the 3.3.0 milestone Feb 26, 2016
9prady9 added a commit that referenced this pull request Feb 26, 2016
@9prady9 9prady9 merged commit b40c7db into arrayfire:devel Feb 26, 2016
@jnicholls
Copy link

Excellent! :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants