"Peter Dimov" <[EMAIL PROTECTED]> writes:

> From: "David Abrahams" <[EMAIL PROTECTED]>
>> "Peter Dimov" <[EMAIL PROTECTED]> writes:
>>
>> > I don't see why you expect remove_pointer(T) to work when T is not a
>> > pointer.
>>
>> I think that's a reasonable expectation, if by "work" you mean return
>> the original type without modification.  That's what it does for "int"
>> arguments, for example.
>
> I would argue that remove_pointer should cause a compile-time error when
> applied to a non-pointer. *p doesn't just "conveniently" return p when
> applied to a non-pointer.
>
> Either way though, it should be consistent, i.e. if it works for int, it
> should work for everything.

I think silent non-modification is a more-useful behavior; it saves on

  if_<is_pointer<T>, remove_pointer<T>, identity<T> >

which is sometimes what you want.

-- 
Dave Abrahams
Boost Consulting
www.boost-consulting.com

_______________________________________________
Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost

Reply via email to