AMDG Peng Yu wrote:
I tried to read the source code to figure out how BOOST_TYPEOF works. But I still don't understand how it works. Can somebody tell me how it works?
It works in 3 different ways depending on your compiler.
1) If your compiler has a typeof operator, Boost.Typeof uses that.
2) If your compiler has a specific bug that allows certain class
templates to be specialized on the fly, Boost.Typeof uses this
capability to associate each type with a unique integer and
get something to the effect of
typename get_associated_type