В бустовой библиотеке есть файл has_new_operator.hpp.Я получаю следующую ошибку при компиляции файла с использованием GCC 4.3.1
type_traits / has_new_operator.hpp: 45: ошибка: неверное количество аргументов шаблона (1, должно быть 2) type_traits / has_new_operator.hpp: 24: ошибка: предоставляется для 'template struct boost :: detail :: test'
в соответствии со строкой 24, он ожидает 2 аргумента, и это то, что было передано в строке 42. Также, еслиВы наблюдаете строку 31, то же самое было сделано, но компилятор не жалуется на это.
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
);