OK, I know installed the latest version of boost, which uses has_new_operator type trait.
But , know I am getting compiler errors , for this minimal test program :
#include <boost/type_traits/has_new_operator.hpp>
class A {
public:
void* operator new(std::size_t);
void* operator new[] (size_t);
void* operator new(std::size_t, void*);
};
int main()
{
boost::has_new_operator<A>();
}
The compiler errors are :
Error 1:
error C2975: 'b1' : invalid template argument for 'boost::type_traits::ice_or', expected compile-time constant expression \libs\boost\inc\boost-1_41\boost\type_traits\has_new_operator.hpp 100
Error 2 :
error C2866: 'boost::detail::has_new_operator_impl<T>::s1' : a const static data member of a managed type must be initialized at the point of declaration \libs\boost\inc\boost-1_41\boost\type_traits\has_new_operator.hpp 93
Error 3:
Error 1 error C2668: 'boost::detail::has_new_operator_impl<T>::check_sig' : ambiguous call to overloaded function \libs\boost\inc\boost-1_41\boost\type_traits\has_new_operator.hpp 93
If you can see what the problem is
Thank you for your time
** I don't know which version of boost you're using. The most recent
I notice that the crash maybe has to do something with that, that my
CustomClass implements its own new and delete operators.
I know that the default implementation of load_construct data uses operator
placement ::new ( global new operator ) to allocate object when loading
through pointer, a
version(s) make use of the type trait
"has_new_operator" to call a class specific new operator. Without having a
specific case to play with
I don't know for sure, but it may address you're situation.
Robert Ramey
_______________________________________________
Boost-users mailing list
Boost-users@lists.boost.org
http://lists.boost.org/mailman/listinfo.cgi/boost-users