News for hackers. Stuff that matters.
Re:How to Use Go Interfaces by stevedonovan on Tuesday March 20, 2018 @08:32AM (#16627935)
Compile-time duck typing :) To be fair, C++ templates have a similar problem. Rust nails this one with traits, I think.
Re:How to Use Go Interfaces by pjmlp on Tuesday March 20, 2018 @02:15PM (#16631083)
C++17 has mechanism to validate if a type implements a certain "interface" (pure virtual base class) via type traits, if constexpr and enable_if, and hopefully with concepts a solution similar to traits will then be possible (already available on gcc).