Chris Goller
David-
First, thanks for the response. BTW, I really like the book.
Thank you; I'll make sure that Aleksey knows.
Okay, I understand what you are saying about add_const and how it works.
My next question is why was it implemented in that way? In other words, was there a specific reason not to make a special case for references such that add_const
would be int const &?
I can't speak for the designer (John Maddock, I think), but: 1. in general special cases are best avoided. They make interfaces harder to explain and use. 2. In this case there's no obvious advantage to making a special case. 3. The type traits library is basically designed to reflect the standard's definitions and rules. That would be a gratuitous deviation. -- Dave Abrahams Boost Consulting www.boost-consulting.com