Boost logo

Boost :

From: Est (esteban_at_[hidden])
Date: 2007-01-22 14:38:32


In my case, I specialized the value_initialized template like this

#include<boost/utility/value_init.hpp>

namespace boost
{
namespace vinit_detail
{

template<class T>
class const_T_base<fugu::vector2_t<T> >
{
protected :

        const_T_base() : x(0,0) {}
        fugu::vector2_t<T> x;
};

template<class T>
struct non_const_T_base<fugu::vector2_t<T> >
{
   protected :

    non_const_T_base() : x(0,0) {}
    mutable fugu::vector2_t<T> x;
} ;

} // namespace
} // namespace

and then I can do

fugu::vector2_t<float> y; // no initialization
boost::value_initialized<fugu::vector2_t<float> > x; // now x is [0,0]

but I'm not sure if it is a good solution...

By the way, the lib can be downloaded at:

http://sourceforge.net/projects/fugu-lib/

It has small vectors and matrices with support for serialization and
iterators
and some other things.

Est.


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk