Boost logo

Boost :

From: Christian Holmquist (c.holmquist_at_[hidden])
Date: 2007-04-17 17:15:01


Hello,

> So far, I've been using:
>
> template<typename T>
> struct storable : public
> boost::remove_const<typename
> boost::remove_reference<T>:
>
> :type > {};

I've done the same for the same reason, but with the less inventive name
remove_const_reference.
FWIW, I would have appreciated something in type_traits to solve this more
elegantly.

> In my automata library, I defined a data_type
> metafunction that removes const, pointer, reference,
>volatile, and [] qualifiers from the input type.

Could you post the function here? Or would it be possible to eventually have
it added to the type_traits library?

Thanks,
 Christian

On 17/04/07, Cromwell Enage <sponage_at_[hidden]> wrote:
>
> --- Stjepan Rajko wrote:
> > Hi,
>
> Hello.
>
> > I am wondering if there is a construct in boost
> > which, given a type T, returns the underlying
> > "storable" type - say if T is int & the
> > "storable_type" should be int. I'm not sure if
> > the word "storable" is the best word...
>
> I was thinking "data" type.
>
> > The scenario I am facing is making a function call
> > that takes a parameter of type T, where I need to
> > prepare the parameter before calling (specifically,
> > deserializing it from an archive). Hence, as far
> > as I can tell, I need to declare a variable of the
> > underlying storable type, and get the right value
> > inside it.
> >
> > So far, I've been using:
> >
> > template<typename T>
> > struct storable : public
> > boost::remove_const<typename
> > boost::remove_reference<T>::type > {};
> >
> > but I'm not sure if that cuts it in all situations.
>
> In my automata library, I defined a data_type
> metafunction that removes const, pointer, reference,
> volatile, and [] qualifiers from the input type.
>
> > In any case, I figured the right thing might be in
> > Boost already and I just haven't found it.
> >
> > Any suggestions?
>
> FWIW, I should be asking the same question. I'm
> curious myself.
>
> Cromwell D. Enage
>
>
> __________________________________________________
> Do You Yahoo!?
> Tired of spam? Yahoo! Mail has the best spam protection around
> http://mail.yahoo.com
> _______________________________________________
> Unsubscribe & other changes:
> http://lists.boost.org/mailman/listinfo.cgi/boost
>


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