Re: Registrar question... bug?
Status: Alpha
Brought to you by:
madduck
|
From: martin f k. <ma...@ma...> - 2004-06-01 12:16:46
|
also sprach stephan beal <st...@s1...> [2004.06.01.1248 +0200]: > > Yes, you are correct. It should probably be static. > > > > But then again, there's a problem because then it needs to be > > initialised, and since libfac is header-only... >=20 > Eeeek... i can see where this is heading. That's the reason that > s11n's registration objects are in anonymous namespaces: to allow > such initialization without ODR violations. i banged my head for > days trying to figure that out, though. Maybe the Registrar should > be moved into an anonymous namespace? What's the difference between what you want and what I do with the macros? The registrars are created in anonymous namespaces... aren't they? I doubt you want the class to be in an anonymous namespace... > > I think I considered that and chose to make the builder > > non-static because the size overhead is zero and it's not like > > you'll create one million registrars for the same type combo. > > or? >=20 > i think you're right. >=20 > My main concern is the possible end-user confusion when he > registers 2 keys for the same type. As a user i would expect the > LAST-run registration to take effect, but in fact only the > first-run registration would happen. So we should add an error policy, or figure out a way to make this a compiler error. like using static asserts. i'd like that the most. --=20 martin; (greetings from the heart of the sun.) \____ echo mailto: !#^."<*>"|tr "<*> mailto:" net@madduck =20 invalid/expired pgp subkeys? use subkeys.pgp.net as keyserver! spamtraps: kra...@ai... mad...@ma... =20 "man soll nicht in kirchen gehn, wenn man reine luft atmen will." - friedrich nietzsche |