Skip to content
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

Provide Vector.wrap() or something similar #44

Closed
samchon opened this issue Jul 25, 2019 · 0 comments
Closed

Provide Vector.wrap() or something similar #44

samchon opened this issue Jul 25, 2019 · 0 comments
Assignees
Labels
enhancement New feature or request
Projects

Comments

@samchon
Copy link
Owner

samchon commented Jul 25, 2019

Provide Vector.wap() static function who wraps an Array into a new Vector.

Unlike copy constructor who copies full elements of the parametric Array to new one, the Vector.wrap() takes reference of the parameric Array directly. Thus, changing elements of the Vector means changing elements of the parametric Array too.

class Vector<T>
{
    public static wrap(array: Array<T>): Vector<T>
    {
        let ret: Vector<T> = new Vector;
        ret.data_ = array;
        return ret;
    }
}
@samchon samchon added the enhancement New feature or request label Jul 25, 2019
@samchon samchon self-assigned this Jul 25, 2019
@samchon samchon added this to To do in v2.2 Update via automation Jul 25, 2019
samchon pushed a commit that referenced this issue Jul 25, 2019
@samchon samchon moved this from To do to In progress in v2.2 Update Jul 25, 2019
samchon pushed a commit that referenced this issue Jul 28, 2019
@samchon samchon closed this as completed Jul 28, 2019
v2.2 Update automation moved this from In progress to Done Jul 28, 2019
@samchon samchon moved this from Done to Patch in v2.2 Update Jul 28, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
No open projects
v2.2 Update
  
Patch
Development

No branches or pull requests

1 participant