boostorg / graph

Boost.org graph module
http://boost.org/libs/graph
325 stars 208 forks source link

Fix named parameter overload of `boykov_kolmogorov_max_flow` #304

Closed sebrockm closed 2 years ago

sebrockm commented 2 years ago

Fixes #232

jeremy-murphy commented 2 years ago

So I take it that test of the bundled properties failed until you fixed the return type of the named parameter overload? I just want to understand exactly what the change fixes. And why does it need to use put instead of operator[] now?

jeremy-murphy commented 2 years ago

And... thank you!

sebrockm commented 2 years ago

@jeremy-murphy Yes, the return type was the only error. It always expected the value type of the interior capacity property map, never the one provided via named parameters. (I sometimes hear people saying that they don't like auto as return type. From now on I will point them to this error 😅 ) put instead of operator[] was honestly just a leftover from some early trials of investigation of this error. At some point I had a test that used a property map that didn't have operator[] and compilation failed. The test itself turned out to be non-constructive for identifying this issue, so I removed it. But I kept the put because I think writable property maps are not required to support operator[], only put.