help-gplusplus
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: strange link problem


From: Dietmar Kuehl
Subject: Re: strange link problem
Date: Tue, 07 Mar 2006 14:34:28 +0100
User-agent: KNode/0.10.1

rmansfield@gmail.com wrote:
> The problem is because static data members need to be defined exactly
> once in every translation unit.

Nope! Static data members have to be defined exactly once in the
whole program. The only exception are constant integral expressions
whose address is never taken: these don't need any definition.
However, addresses are easily taken, e.g. by passing the value to a
function taking an 'int const&' as parameter. The best bet for a
constant integral expression which does not need a separate
definition is using an enum.
-- 
<mailto:dietmar_kuehl@yahoo.com> <http://www.dietmar-kuehl.de/>
<http://www.eai-systems.com> - Efficient Artificial Intelligence


reply via email to

[Prev in Thread] Current Thread [Next in Thread]