Boost logo

Boost :

From: christopher diggins (cdiggins_at_[hidden])
Date: 2004-05-24 10:39:57

----- Original Message -----
From: "Daryle Walker" <darylew_at_[hidden]>
To: "Boost mailing list" <boost_at_[hidden]>
Sent: Saturday, May 22, 2004 1:37 PM
Subject: Re: [boost] Ranged type mini-library submission

> On 5/16/04 11:09 AM, "christopher diggins" <cdiggins_at_[hidden]> wrote:
> Should those "value" types be more like "value_type" to reduce confusion
> what that member is?
> --
> Daryle Walker
> Mac, Internet, and Video Game Junkie
> darylew AT hotmail DOT com

The version at is less
confusing I think. Though I still use value instead of value_type, I think
it is perhaps more clear from the context that value is a type as opposed to
another kind of identifier. I have included the latest version below so that
a copy will exist for perpetuity in the list archives. I will be posting
documentation on Tuesday.

#ifndef BOOST_CV_HPP
#define BOOST_CV_HPP
#include <boost/mpl/if.hpp>
namespace boost
  namespace cv
      class constraints_policy,
      bool implicit_conversion_policy = true
    class constrained_value {
        struct unused_struct { };
        typedef constrained_value<constraints_policy,
implicit_conversion_policy> self;
        typedef typename constraints_policy::value value;
        typedef typename mpl::if_c<implicit_conversion_policy, value,
unused_struct>::type value_parameter;
        static constraints_policy get_constraints() { return
constraints_policy(); }
        constrained_value() { }
        constrained_value(const self& x) { assign(x.get_value()); }
        constrained_value(value_parameter x) { assign(x); }
        const value get_value() const { return m; }
        operator value() { return m; }
        self& operator=(const self& x) { assign(x.get_value()); return
*this; }
        self& operator=(value_parameter x) { assign(x); return *this; }
        void assign(unused_struct x) { }
        void assign(value_parameter x) { constraints_policy::assign(x, m); }
        value m;
#endif // BOOST_CV_HPP

Christopher Diggins

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