Checking if a stand-alone function exists
Hi, Is there a way of checking if a stand-alone function exists? Thanks
On Mon, Oct 25, 2010 at 4:48 PM, Ioannis Papadopoulos
Maybe you want a linker "weak reference"? I don't know how portable the concept is, but it's been around for a while. The idea is that your calling module tries to reference an extern. But because that extern is marked (somehow) as a weak reference, absence of that symbol at link time, instead of failing the build, produces an executable in which the referenced symbol has value 0 instead of pointing to a function.
On Mon, Oct 25, 2010 at 4:48 PM, Ioannis Papadopoulos
Hi,
Is there a way of checking if a stand-alone function exists?
Thanks
If you need this as compile-time functionality and the function you want to look for is not nullary then I believe you should be able to hack together a solution using SFINAE, at least in 0x. -- -Matt Calabrese
Do you have any hints on how to do that? (C++0x is fine) Thanks On 10/27/2010 12:22 PM, Matt Calabrese wrote:
On Mon, Oct 25, 2010 at 4:48 PM, Ioannis Papadopoulos
mailto:ipapadop@cs.tamu.edu> wrote: Hi,
Is there a way of checking if a stand-alone function exists?
Thanks
If you need this as compile-time functionality and the function you want to look for is not nullary then I believe you should be able to hack together a solution using SFINAE, at least in 0x.
-- -Matt Calabrese
_______________________________________________ Boost-users mailing list Boost-users@lists.boost.org http://lists.boost.org/mailman/listinfo.cgi/boost-users
On Wed, Oct 27, 2010 at 9:16 PM, Ioannis Papadopoulos wrote: Do you have any hints on how to do that? (C++0x is fine) Thanks Here's a quick test with mixed results, though it's fairly hacky.
//////////
#include
participants (4)
-
Ioannis Papadopoulos
-
Ioannis Papadopoulos
-
Matt Calabrese
-
Nat Linden