Skip to content

Comments

[Compilation fix] Ensure proper aligned_allocator definition by using vector-aligned#3

Open
hrobeers wants to merge 1 commit intojbaayen:masterfrom
hrobeers:vector-aligned
Open

[Compilation fix] Ensure proper aligned_allocator definition by using vector-aligned#3
hrobeers wants to merge 1 commit intojbaayen:masterfrom
hrobeers:vector-aligned

Conversation

@hrobeers
Copy link

https://github.com/jbaayen/vortexje/blob/master/vortexje/solver.cpp#L1003 Fails to compile in recent eigen releases due to improper allocator definition.

A simple fix could be replacing:

vector<vector<Vector3d, Eigen::aligned_allocator<Vector3d> >, Eigen::aligned_allocator<vector<Vector3d> > > wake_velocities;

with:

vector<vector<Vector3d, Eigen::aligned_allocator<Vector3d> >, Eigen::aligned_allocator<vector<Vector3d, Eigen::aligned_allocator<Vector3d> > > > wake_velocities;

However, a more readable and less error prone solution is proposed by this pull request with the introduction of vector_aligned:

  template <typename T>
  using vector_aligned = std::vector<T, Eigen::aligned_allocator<T> >;

…ixes compilation with recent eigen releases)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant