Stephan Ceram wrote:
>> I wonder, why all those questions? Did it have anything to do
>> with the problem the OP experienced? Generally speaking, the
>> link error (this is what the OP's got, isn't it?) is because it
>> is a function template that is used in 'main' and its source is
>> not visible so that the compiler can generate the function. But
>> the design has really nothing to do with it, does it? Simply
>> tell the OP to place the definition in the header.
>
> That's my point. But when I place the definition into the header
> which I want to make visible to other users as API to my library,
> also the definition of A::func becomes visible to everyone. And
> this is what I would like to avoid. This was the reason of my post
> to ask you if there are any solution to not change the semantics
> of my code example but still somehow keep the definition of A::func
> hidden.
"How do I make it visible to the client's compiler but not to the
clients themselves?" Well, use a compiler that sup****ts template
ex****t and tell the clients to do the same. If you can, that is.
If you cannot, you're SOL.
V
--
Please remove capital 'A's when replying by e-mail
I do not respond to top-posted replies, please don't ask


|