Hello, All.

   I've got a little problem when implicit conversion from zero to pointer can 
cause 
calling of wrong overloaded function. For example, foo(bool a) and foo(void* a) 
both can 
be called as foo(0) and compiler used to throw error for this call, but in some 
(more 
complex) cases compiler can silently choose wrong function that leads to crash.
   May be somewhere in sources already exists solution for this problem?
   If not, class like this can prevent that:

class strictly_pointer
{
        void* val;
public:
        strictly_pointer(void* v): val(v) {}
        strictly_pointer(int) = delete;
        operator void*() { return val; }
};

-- 
   WBR, SD.

------------------------------------------------------------------------------
What NetFlow Analyzer can do for you? Monitors network bandwidth and traffic
patterns at an interface-level. Reveals which users, apps, and protocols are 
consuming the most bandwidth. Provides multi-vendor support for NetFlow, 
J-Flow, sFlow and other flows. Make informed decisions using capacity 
planning reports. https://ad.doubleclick.net/ddm/clk/305295220;132659582;e
Firebird-Devel mailing list, web interface at 
https://lists.sourceforge.net/lists/listinfo/firebird-devel

Reply via email to