We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 73f98c6 + e876589 commit 2a371bdCopy full SHA for 2a371bd
1 file changed
python/src/codac2_py_matlab.h
@@ -57,9 +57,9 @@ namespace codac2
57
return x;
58
}
59
60
- inline std::vector<Index> convert_indices(const std::vector<Index_type>& indices)
61
- {
62
- if constexpr(FOR_MATLAB)
+ #if FOR_MATLAB
+
+ inline std::vector<Index> convert_indices(const std::vector<Index_type>& indices)
63
{
64
std::vector<Index> indices_(indices.size());
65
for(size_t i = 0 ; i < indices.size() ; i++)
@@ -71,8 +71,14 @@ namespace codac2
71
return indices_;
72
73
74
- else
+ #else
75
76
+ // Returning a reference (avoid a copy as in FOR_MATLAB mode)
77
+ inline const std::vector<Index>& convert_indices(const std::vector<Index>& indices)
78
+ {
79
return indices;
- }
80
+ }
81
82
+ #endif
83
84
0 commit comments