Matthew Woehlke
2018-11-27 17:31:48 UTC
So, I was fiddling with something of a "toy" application yesterday that
implements a tree model... long story short, I ended up trying to write
some code like:
return createIndex(row, column, &m_foo);
...which fails to compile with 'no suitable overload for (int, int, Foo
const*)'.
But... why *isn't* there such an overload? Is there any reason not to
add one? (Should I submit a patch doing so?) I think doing so is BC and
*mostly* SC, with the SIC parts being on the list of "acceptable
breakage". (Note: This would require also adding a std::nullptr_t
overload to disambiguate the `createIndex(x, y, nullptr)` case, and
presumably adding equivalent QModelIndex ctor overloads.)
implements a tree model... long story short, I ended up trying to write
some code like:
return createIndex(row, column, &m_foo);
...which fails to compile with 'no suitable overload for (int, int, Foo
const*)'.
But... why *isn't* there such an overload? Is there any reason not to
add one? (Should I submit a patch doing so?) I think doing so is BC and
*mostly* SC, with the SIC parts being on the list of "acceptable
breakage". (Note: This would require also adding a std::nullptr_t
overload to disambiguate the `createIndex(x, y, nullptr)` case, and
presumably adding equivalent QModelIndex ctor overloads.)
--
Matthew
Matthew