The boost library has a has_new_operator.hpp file. I get the following error when I complicate a file using GCC 4.3.1
type_traits / has_new_operator.hpp: 45: error: invalid template number arguments (1, must be 2) type_traits / has_new_operator.hpp: 24: error: for "template struct boost :: detail :: test"
on line 24, it expects 2 arguments, and this is what was passed on line 42. Also, if you observe line 31, the same thing was done, but the compiler does not complain about it.
21: namespace boost { 22: namespace detail { 23: template <class U, U x> 24: struct test; 25: 26: template <typename T> 27: struct has_new_operator_impl { 28: template<class U> 29: static type_traits::yes_type check_sig1( 30: U*, 31: test< 32: void *(*)(std::size_t), 33: &U::operator new 34: >* = NULL 35: ); 36: template<class U> 37: static type_traits::no_type check_sig1(...); 39: template<class U> 40: static type_traits::yes_type check_sig2( 41: U*, 42: test< 43: void *(*)(std::size_t, const std::nothrow_t&), 44: &U::operator new 45: >* = NULL );
source share