mbed-os/TESTS/mbed_functional/functionpointer
Christopher Haster 756a09003c Added explicit void specialization in callbacks
One limitation of C++ is that implicit casts do not occur when
matching template overloads, as a consequence the callback's
argument type requires a strict match.

Unfortunately, the prevents the previously common pattern of using
void pointers as function arguments, causing unnecessary problems
for users porting code.

        Thing *t;
        void doit(void *p) { blablabla }

        Callback<void()> cb(t, doit);

To avoid this, explicit overloads on void pointers were added. This
avoids a template expansion, and allows the implicit cast to occur
as the user would expect.
2016-08-26 12:50:13 -05:00
..
main.cpp Added explicit void specialization in callbacks 2016-08-26 12:50:13 -05:00