Boost logo

Boost Users :

From: Felipe Magno de Almeida (felipe.m.almeida_at_[hidden])
Date: 2005-05-20 21:58:20

On 5/19/05, Gottlob Frege <gottlobfrege_at_[hidden]> wrote:


> template <typename T> class C
> {
> int fooCount()
> {
> static int foo = 0;
> return ++foo;
> }
> };


> I suppose a compiler could still make the code common, but with
> separate static foo's, but then in general, there is nothing stopping
> a compiler from looking at 2 unrelated functions and saying, 'hey,
> lots of the code here looks the same; I should just refactor some of
> it out and remove some code bloat'. Not sure much of that ever
> happens. Reality is that once upon a time there were compiler
> switches for size vs speed, but speed won.
I have one question:

Isnt &C<int>::fooCount garanteed to be different from &C<long>::fooCount ?


> Tony
> _______________________________________________
> Boost-users mailing list
> Boost-users_at_[hidden]

   Felipe Magno de Almeida
   UIN: 2113442
    email: felipe.m.almeida+spam at gmail com felipe.almeida+spam at
ic unicamp br, felipe.m.almeida at gmail com, felipe+spam at synergy
(Remove the +spam from the email)
I am a C, modern C++, MFC, ODBC, Windows Services, MAPI developer
from synergy, and Computer Science student from State
University of Campinas(UNICAMP).
To know more about:
current work:
"There is no dark side of the moon really. Matter of fact it's all dark."

Boost-users list run by williamkempf at, kalb at, bjorn.karlsson at, gregod at, wekempf at