level 12
你应该CE了:
reurn:undeclared identifier
2012年09月16日 00点09分
4
![[揉脸]](/static/emoticons/u63c9u8138.png)
亮了
2012年09月16日 14点09分
level 11
#ifndef CACHEDOBJ_H_INCLUDED
#define CACHEDOBJ_H_INCLUDED
#include <cstddef>
#include <memory>
#include <stdexcept>
template <class T> class CachedObj {
public:
void *operator new(std::size_t);
void operator delete(void *,std::size_t);
virtual ~CachedObj(){}
protected:
T *next;
private:
static void add_to_freelist(T *);
static std::allocator<T> alloc_mem;
static T *freeStore;
static const std::size_t chunk;
};
#include "CachedObj.cpp"
#endif
2012年09月16日 14点09分
5
![[Yeah]](/static/emoticons/Yeah.png)
终于优化好了
2012年09月16日 14点09分
level 11
#ifndef
CACHEDOBJ_H_INCLUDED
#define
CACHEDOBJ_H_INCLUDED
#include
<
cstddef
>
#include
<
memory
>
#include
<
stdexcept
>
template
<
class
T
>
class
CachedObj
{
public
:
void
*
operator
new
(
std
:
:
size_t
)
;
void
operator
delete
(
void
*
,
std
:
:
size_t
)
;
2012年09月16日 14点09分
6
level 11
virtual
~
CachedObj
(
)
{
}
protected
:
T
*
next
;
private
:
static
void
add_to_freelist
(
T
*
)
;
static
std
:
:
allocator
<
T
>
alloc_mem
;
static
T
*
freeStore
;
static
const
std
:
:
size_t
chunk
;
}
;
#include
"
CachedObj
.
cpp
"
#endif
2012年09月16日 14点09分
7