Beware of the dangers of C++ overloading

29 views
Skip to first unread message

Nil Geisweiller

unread,
Oct 7, 2019, 4:34:41 AM10/7/19
to opencog
Fellow C++ dev, just a warning after being brought to the edges of
madness by the following bug (item 2)

https://github.com/opencog/miner/pull/14

TL;DR version:

Never overload a C++ function with different semantics depending on
argument types because C++ may silently convert your object especially
when you expect it the least.

different semantics <=> different names

Nil

Abdulrahman Semrie

unread,
Oct 28, 2019, 8:58:34 AM10/28/19
to opencog
Can you please post an excerpt or an example? Thanks
Reply all
Reply to author
Forward
0 new messages