
1 Sep
2011
1 Sep
'11
8:43 a.m.
On 01/09/2011 10:30, Mathias Gaunard wrote:
On 01/09/2011 05:26, Andrey Semashev wrote:
In addition, on most platforms there will be multiple instances of type_id<T>::value for a single given T if the application uses type_id<T> in multiple modules.
That's not a problem, type_id<T>::value is a weak symbol.
These instances will be initialized independently and most likely will have different ids. And since next_id() is also module-private, inter-module passing of boost::any becomes totally impossible.
You could make next_id a function with weak extern linkage, which should be able to make it work.
The attached testcase appears to work. It doesn't, of course, if next_id is static.