79446076

Date: 2025-02-17 16:50:56
Score: 0.5
Natty:
Report link

Not being fluent in C++, I followed a few examples I found and they used auto type. So did I.

auto model = tflite::FlatBufferModel::BuildFromFile(model_path.c_str());

This line is problematic. I assumed auto induced the type from the private variable declaration, but I guess it overrides it and is still accessible from other function calls.

Removing auto and just calling

model = tflite::FlatBufferModel::BuildFromFile(model_path.c_str()); works as expected.

Reasons:
  • Has code block (-0.5):
  • Self-answer (0.5):
  • Low reputation (0.5):
Posted by: Maja