Boost logo

Boost Users :

From: David Abrahams (dave_at_[hidden])
Date: 2005-02-15 23:22:52


Chris Goller <cgoller_at_[hidden]> writes:

> 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<int&> 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

Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net