From d9af320fbdfdadd70815d4f14a9116829dfabdf0 Mon Sep 17 00:00:00 2001 From: Karen Arutyunov Date: Fri, 2 Nov 2018 17:16:31 +0300 Subject: Generalize function_cast() to cast between incompatible function pointers --- libbutl/utility.mxx | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'libbutl/utility.mxx') diff --git a/libbutl/utility.mxx b/libbutl/utility.mxx index f944599..5d093ad 100644 --- a/libbutl/utility.mxx +++ b/libbutl/utility.mxx @@ -315,11 +315,12 @@ LIBBUTL_MODEXPORT namespace butl F f_; }; - // Cleanly cast dlsym() result (void*) to a function pointer. + // Cleanly cast between incompatible function types or dlsym() result + // (void*) to a function pointer. // - template + template F - function_cast (void*); + function_cast (P*); // Call a function if there is an exception. // -- cgit v1.1