Closed BigUglySpider closed 3 years ago
On further inspection, this is in-line with the rest of reference implementations, which is to assume the user knows what they are doing and that they assign references correctly (as per any reference in C++).
This same concept definitely expands to now passing temporaries when making a reference matrix - doing so is explicitly deciding to delve into undefined behaviour.
As such, they will be left as is for the foreseeable future as of this comment. However, more work may be put into this at a later date to improve the library's safety. As such, it will be labelled as shelved rather than addressed.
There is potential that, under certain circumstances, one can create a matrix of references which is initialised with a temporary value (e.g. making_vector(some_args..., 2, other_args...); can potentially be allowed).
This can lead to either leaks in memory or, much more likely, dangling references which appear to work for a short while.