Boost logo

Boost :

From: Brian Braatz (brianb_at_[hidden])
Date: 2005-06-04 16:48:32


HAHAHAHA

Nevermind.

     copy_col_if_in_dest<boost::mpl::at<src::typelist,
boost::mpl::int_<0>
>::type,src::typelist>();

instead of being src::typelist (which is a ref to the param of type
src_t) it needs to be src_t::typelist.

it was indeed something stupid-

I am undecided as to which is more stupid. The fact that I didn't catch
that or the fact that MSVC ICE'd on it......

sorry for bugging you guys

> -----Original Message-----
> From: Brian Braatz
> Sent: Saturday, June 04, 2005 2:38 PM
> To: 'boost_at_[hidden]'
> Subject: ICE ICE BABY! (my MPL code is ICEing)
>
> Sitting in the backyard.
>
> Beautiful day, got up at 3am to get something figured out (for
proposed
> boost profiler \ introspection library).
>
> Good news is I figured out the MPL code needed to accomplish my goal.
> After typing in an incremental version of the code, I got the dreaded
> internal compiler error (ICE).
>
> I am chewing on this- and thought I would post it so to provide an
> opportunity for someone to show how incredibly stupid I am because I
did
> something that was obviously wrong. (you can even rub my nose in it if
you
> like :) )
>
> here is the code:
>
> I am tearing it apart\deconstructing to try to figure out what is
kicking
> in the ICE. (I am also going to try it with an eval_if (which I should
be
> using anyway) just to see what happens)
>
> I am using boost 1.32 and vc7.1
>
> struct do_copy_col
> {
> typedef do_copy_col type;
> do_copy_col()
> {
> std::cout << "do_copy_col" << std::endl;
> }
> // todo- implement operator()(dest,src)
> };
> struct do_not_copy_col
> {
> typedef do_not_copy_col type;
> do_not_copy_col()
> {
> std::cout << "do_not_copy_col" << std::endl;
> }
>
> // todo- implement operator()(dest,src)
> };
>
> template <class type_t, class sequence_t>
> struct copy_col_if_in_dest
> : public if_< typename is_same< typename deref<typename
> boost::mpl::find<sequence_t, type_t>::type >::type, type_t>,
do_copy_col,
> do_not_copy_col>::type
> {
> };
>
> template <class src_t, class dest_t>
> void copy_union(src_t & src, dest_t & dest)
> {
> copy_col_if_in_dest<boost::mpl::at<src::typelist,
boost::mpl::int_<0>
> >::type,src::typelist>();
> }


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