DarkSharpness commented on PR #218:
URL: https://github.com/apache/tvm-ffi/pull/218#issuecomment-3483946859
ic. but consider this case:
```
#include <cstdio>
struct MyClass {};
struct iterator_0 {
MyClass operator*() { return {}; }
};
struct iterator_1 {
const MyClass operator*() { return {}; }
};
auto func(MyClass&&) -> void { std::puts("rvalue"); }
auto func(const MyClass&) -> void { std::puts("lvalue"); }
auto main() -> int {
iterator_0 it0;
iterator_1 it1;
func(*it0); // rvalue
func(*it1); // lvalue
}
```
For a iterator returning const `value_type`, it will choose the lvalue
resolution, which may be less performant for heap-allocated values (especially
STL components, like `vector`, `string`).
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]