Boost logo

Ublas :

From: Daryle Walker (darylew_at_[hidden])
Date: 2005-01-24 14:33:25


On 1/22/05 12:06 PM, "Michael Stevens" <m-stevens_at_[hidden]> wrote:

[SNIP]
> uBLAS_pure specificly made the distinction by requiring elements be
> constructible from zero. This also means that the hundred or so location in
> uBLAS where this is required are easy to find! I think at the uBLAS meeting
> we discussed more user friendly solutions but they require consistent
> application and detail thought about the semantics.
>
> Personally I think the zero construable requirement has the advantage that it
> is simple and requires no template magic external to the class type. Also
> specifying element requirements and semantics that are consistent and
> efficient for both dense and sparse containers is not easy!
[TRUNCATE]

I don't know much about uBLAS, so sorry if I sound like an uneducated
newbie. This sounds like you use "value_type(0)" whenever you need a zero
value for a type. What's wrong with "value_type()"? Every built-in and
user-defined numeric (scalar) type I know of makes the explicit default
constructor evaluate its object to zero. This policy would be easier to
accept for types that didn't want an "int" constructor. You have to use the
explicit syntax because implicit default construction for built-in types
leaves them as a bucket of random bits (for C compatibility and to not add
extra code).

-- 
Daryle Walker
Mac, Internet, and Video Game Junkie
darylew AT hotmail DOT com