Boost logo

Boost :

Subject: Re: [boost] [review][constrained_value] ReviewofConstrainedValueLibrary begins today
From: Robert Kawulak (robert.kawulak_at_[hidden])
Date: 2008-12-07 18:56:07

> From: Chris
> Sorry I did not clarify that there were no default template
> parameters.
> (no error policy)
> must_initialize was not referring to any of your constrained
> classes.
> It was just a simple class to be added to your library if you wanted,
> that forces the user to initialize a variable. That is the
> compile time
> constraint.
> template <typename T>
> class must_initialize
> {
> public:
> must_initialize(T t) : _value(t) { }
> // operater overloads here
> private:
> must_initialize();
> T _value;
> };

I'm not sure I got it -- how must_initialize would be supposed to be used? Like

        constrained<must_initialize<int>, is_odd> odd_int;
        odd_int x; // error
        odd_int y(1); // OK

This would indeed make sense, but I think this class should be added to
Boost.Utility (like value_initialized) rather than here...

Best regards,

Boost list run by bdawes at, gregod at, cpdaniel at, john at