Add std::vector constructor to Array class

Registered by Anders Logg

We need to add a constructor to the Array class that takes an std::vector as input to simplify integration with codes based on STL types.

Blueprint information

Status:
Complete
Approver:
None
Priority:
Undefined
Drafter:
None
Direction:
Needs approval
Assignee:
None
Definition:
Obsolete
Series goal:
None
Implementation:
Unknown
Milestone target:
None
Completed by
Garth Wells

Related branches

Sprints

Whiteboard

This can already be done easily:

  std::vector<double> v(20);
  dolfin::Array<double>(&v[0], v.size());

Care is required to manage the memory, so I suggest leaving it as is to discourage it's use and to avoid the deep versus shallow copy ambiguity.

(?)

Work Items

This blueprint contains Public information 
Everyone can see this information.

Subscribers

No subscribers.