c********e 发帖数: 383 | 1 I wrote a small piece of code, if you run sbin, the out put is 0 however if
you run shbin the out put is one , which is what i expect...
can not figure out why. Thanks,
///////////////////////////////////////////
//lib.h
#include
#include
#include
template
class SingleTon
{
public:
static T * instance ();
protected:
SingleTon () {}
static T * instance_;
};
class A : public SingleTon
{
public:
A () {}
int size () { return box_.size (); }
void | p***o 发帖数: 1252 | 2 为什么sbin是0不是1?
【在 c********e 的大作中提到】 : I wrote a small piece of code, if you run sbin, the out put is 0 however if : you run shbin the out put is one , which is what i expect... : can not figure out why. Thanks, : /////////////////////////////////////////// : //lib.h : #include : #include : #include : template : class SingleTon
| c********e 发帖数: 383 | 3 u think i would bother to copy my code here if i know the answer?
【在 p***o 的大作中提到】 : 为什么sbin是0不是1?
| c********e 发帖数: 383 | 4 turns out that the test.o is not linked in at all since
there is no symbol needed from it by main.cpp anywhere..
【在 c********e 的大作中提到】 : u think i would bother to copy my code here if i know the answer?
|
|