Re: PeerInfo and PeerId

Hi Peter,

They are different, but I think it does not make a big difference in our case. This page sheds some light on the issue:
[snip]
So static data members are just like static variables declared in namespace scope.

Now it’s clear to me - thanks!

> Well, if we don’t want to restrict our classes to use only intrinsic/primitive types,
> then initializing complex objects in the Test class ctor seems to me as the only solution, too.

We should do so then!

I’ve made necessary changes and it works fine! Now we’re not forced to use only intrinsic/primitive types constants in our classes. You can see the changeset for more info.

Btw we should document this somewhere (declaring complex constants as object constants in tests because of possible static objects initialization order problems), so every developer will be familiar with it and we won’t have any problems. And also make changes in other tests as well (I’ll check Torrent and Bencoding packages).

Have a nice day,

Petr

Would you like to post a relpy?


This post is a reply to:
Re: PeerInfo and PeerId
Hi Petr, I thought so at first (class can be considered as a namespace from my point of view), but then I did a little bit of searching and found that (more...)

Follow-ups:
Re: PeerInfo and PeerId
Hi Petr, I pushed two revisions to developers\peter\calitko-petr please have a look. Maybe the changes to class Uri would have some effects on PeerInfo. Actually this PeerInfo comment made me think (more...)