Tool/software: TI C/C++ Compiler
Hi
I wrote the following code:
#include <hash_set>
struct X
{
};
typedef std::hash_set<X*, std::hash<X*>,std::equal_to<X*>,
std::allocator<X*> > AllocatedBlocksSet;
AllocatedBlocksSet t;
typedef std::hash_set<void*, std::hash<void*>,std::equal_to<void*>,
std::allocator<void*> > VoidPtrBlocksSet;
VoidPtrBlocksSet t1;
void func()
{
X* ret;
t.insert(ret);
}
void func1()
{
X* ret;
t1.insert((void*)ret);
}
func() fails with the following error: "C:/ti/ccsv6/tools/compiler/c6000_8.2.1/include/s__hashtable.h", line 617: error #1034: call of an object of a class type without appropriate operator() or conversion functions to pointer-to-function type
func1 doesn't fail
X* and void* are both pointers so why does one compile and the other doesn't
Thanks
Shiran