I saw in several places talking about efficiency but when I look at sizeof(Value) == 48 (64bits) I'm not sure about it.
sizeof(Value) is 16 bytes. I guess you have tried in DEBUG, where there is some additional diagnostics data.
Quote:
I saw that Value has a String member called "data" and also an Atomic member called "refcount" to be used in special cases, but String also has the same "refcount" for special cases, isn't it a repetition ?
Not at all.
Quote:
I was looking at sizeof(boost::any) == 8 (64bits) and sizeof(cdiggins::any) == 16 (64bits)
How much _total_ memory would boost::any consume if you assign it an int or "Hello world"?
Value will still use 16 bytes _total_ in both cases.
BTW, to investigate such issues further, there is benchamarks/sizeof which I use to track this. Also funny is benchamrks/idmapBench, which benchmarks (among others) ValueMap against STL (that is, high-level U++ thing against low-level STL thing).