Skip to content
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
16 changes: 11 additions & 5 deletions python/src/codac2_py_matlab.h
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,9 @@ namespace codac2
return x;
}

inline std::vector<Index> convert_indices(const std::vector<Index_type>& indices)
{
if constexpr(FOR_MATLAB)
#if FOR_MATLAB

inline std::vector<Index> convert_indices(const std::vector<Index_type>& indices)
{
std::vector<Index> indices_(indices.size());
for(size_t i = 0 ; i < indices.size() ; i++)
Expand All @@ -71,8 +71,14 @@ namespace codac2
return indices_;
}

else
#else

// Returning a reference (avoid a copy as in FOR_MATLAB mode)
inline const std::vector<Index>& convert_indices(const std::vector<Index>& indices)
{
return indices;
}
}

#endif
}
}
Loading