[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-core-devel
Subject:    Re: passing POD by value with const qualifiers. Silly or not?
From:       André_Wöbbeking <Woebbeking () kde ! org>
Date:       2008-02-22 13:28:42
Message-ID: 200802221428.42739.Woebbeking () kde ! org
[Download RAW message or body]

On Wednesday 20 February 2008, Stefan Teleman wrote:
> On Feb 20, 2008 2:25 AM, Andre Wöbbeking <Woebbeking@kde.org> wrote:
> > It makes sense in the implementation but not in the API. As
> > compromise we could remove the const in the header files but leave
> > them in the source files (that is allowed for PODs).
>
> In this case, strictly conforming compilers will generate an
> undefined symbol at link time because of argument constness mismatch
> between the declaration and the implementation. It's neither BC nor
> BIC, it just won't link.

Did you try it? According to the C++ standard e.g.

void foo(int);
void foo(const int);

are equivalent.

But we still support non standard compliant compilers :-( So we should 
probably don't use this feature.


Cheers,
André

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic