Re: question: static objects in LIB
From: Mycroft Holmes (m.holmes_at_nospam.it)
Date: 10/21/04
- Next message: Bonj: "Re: Mixed-mode DLL linked with /NOENTRY requiring HMODULE"
- Previous message: Ravi Ambros Wallau: "Re: trouble converting CFileDialog to CFile to get size"
- In reply to: muchan: "Re: question: static objects in LIB"
- Next in thread: muchan: "Re: question: static objects in LIB"
- Reply: muchan: "Re: question: static objects in LIB"
- Messages sorted by: [ date ] [ thread ]
Date: Thu, 21 Oct 2004 14:56:06 +0200
> If "no" How do you assume they (B and C) are using the same lib A?
we have all source code, and we are sure the class they "share" is the same
file.
> Maybe leave A as DLL and make B and C as user of it, is the solution.
yes, but we'd like to know if there's a pure c++ solution (i.e. something in
the language which allows code to be unique. for example: suppose we put in
an header file:
template <typename T>
struct getUnique
{
static T* Pointer()
{
static T t;
return &t;
}
}
and then invoke getUnique<MyClass>::Pointer().
since the template function is in a header, the linker has to recompile it
everytime, so shall it avoid duplicates?
-- The set of solutions is never empty. Two solutions together form a new problem. -- Mycroft Holmes
- Next message: Bonj: "Re: Mixed-mode DLL linked with /NOENTRY requiring HMODULE"
- Previous message: Ravi Ambros Wallau: "Re: trouble converting CFileDialog to CFile to get size"
- In reply to: muchan: "Re: question: static objects in LIB"
- Next in thread: muchan: "Re: question: static objects in LIB"
- Reply: muchan: "Re: question: static objects in LIB"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|