Příklad
class
A{
public
:
static
void
*
operator
new
(size_t size, newhandler nh);
};
class
B{
public
:
static
void
*
operator
new
(size_t size, newhandler nh);
};
Řešení
Poskytněte výchozí hodnoty pro všechny přebytečné parametry, nebo také definujte výchozí formát jako nový.
class
A{
public
:
static
void
*
operator
new
(size_t size, newhandler n
h
=0
);
};
class
B{
public
:
static
void
*
operator
new
(size_t size, newhandler nh);
static
void
*
operator
new
(size_t size){
return
::
operator
new
(size);
}
};